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 }
scope :by_id, ->(id) {where (:id => id)}
this should work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With