Kang Cao wrote in post #1110456:
> You should use 'where' if you are using rails 3. the find_by method is
> not suggested now. Hence your problem is easy to be resolved by
> "User.where(:age=>25)
Oh, yes, you're right. From Edge Guides:
Dynamic finders have been deprecated in Rails 4.0 and will be
removed in Rails 4.1.
I thought the other way around, that dynamic finders are better choice.
But the thing is that .find_by may return exactly a model object, but
.where returns ActiveRecord::Relation in all cases.