Fix sinatra base #15

merged 2 commits into from Jul 18, 2012


None yet

3 participants

akatz commented Jul 18, 2012

fixes for issue #14

@ejschmitt ejschmitt merged commit b3b9455 into ejschmitt:master Jul 18, 2012


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.

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

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