Reputation: 1703
I somehow cannot find any place in the rails documentation about how to put some params into a named scope, f.e. something like this
scope :by_id, -> { where :id = id }
Upvotes: 3
Views: 3111
Reputation: 106
scope :by_id, ->(id) {where (:id => id)}
this should work
Upvotes: 9