mobility
mobility copied to clipboard
Include query_scope in find_by methods
It makes sense to include the query scope automatically in the find_by methods (find_by_title etc) so they work out of the box.
Assume title is a translated attribute:
Before
Post.i18n.find_by_title('foo')
#=> <Post ...>
Post.find_by_title('foo')
#=> ActiveRecord::StatementInvalid ...
After
Post.i18n.find_by_title('foo')
#=> <Post ...>
Post.find_by_title('foo')
#=> <Post ...>
Would be nice to merge this! @shioyama