Change #find to #where to prevent ActiveRecord::RecordNotFound#702
Conversation
There was a problem hiding this comment.
You're using Ruby 1.9 Hash syntax here. I don't know the general policy here (I just added my first pull request myself) but the other tests (at least the unit tests) use the 1.8 Hash syntax. But from some older commits and the documentation you can see that 1.8 compatibility is desired.
There was a problem hiding this comment.
Yes. Ruby 1.8 compatibility of the whole gem is in fact required, the only place where we commonly use Ruby 1.9 syntax is integration tests (easier on the eyes, most people are on Ruby 1.9, Hash preserves ordering, etc). The unit tests have to use the Ruby 1.8 syntax, because we run the unit tests suite on Ruby 1.8 on Travis (and of course locally).
|
@karmi @robinbrandt I can definitely update to Ruby 1.8 syntax. @karmi If you can point out where I can find a list of supported ORMs I can work on a |
|
@karmi bump |
|
Sorry it hangs in there like this for so long. Any news on this in the meantime? I think you should synchronize with @timoschilling to work out some elegant solution which would pick correct strategy for |
|
Just wondering about the state of this ticket -- I'm all for exposing ORM-specific finder methods in the |
|
Didn't get a chance to work on this till a few minutes ago. How does this look? #810 |
|
Closing in favour of #810. |
As per @karmi's comments on #673 I've only used where when the class inherits ActiveRecord::Base.
Thoughts @karmi?