Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sinatra base #15

Merged
merged 2 commits into from
Jul 18, 2012
Merged

Fix sinatra base #15

merged 2 commits into from
Jul 18, 2012

Conversation

akatz
Copy link
Contributor

@akatz akatz commented Jul 18, 2012

fixes for issue #14

ejschmitt added a commit that referenced this pull request Jul 18, 2012
@ejschmitt ejschmitt merged commit b3b9455 into ejschmitt:master Jul 18, 2012
@ejschmitt
Copy link
Owner

thanks

@ankane
Copy link

ankane commented Mar 2, 2013

Hey Erick,

Please bump the version number of the gem. This commit fixes a huge, unobvious issue.

When sinatra is required, this line is executed in the main space.
https://github.com/sinatra/sinatra/blob/master/lib/sinatra/main.rb#L30

Here's the issue we ran into with Rails 3.2.12 and scopes. (not_found is a scope on the Item model)

# works - returns models
Item.not_found

order = Order.find(1)
order.items.not_found # => returns 404 instead of models

The not_found method is delegated to the sinatra application rather than the rails activerelation after we installed this gem. This commit fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants