The Rails guides state that a scope can be called on an association. But then further on, it states that the scoped method, which returns an ActiveRecord::Relation object, “may come in handy…on associations”. If a scope can be called on an association, what additional functionality does scoped provide?
The Rails guides state that a scope can be called on an association. But
Share
scopedreturns an anonymous scope. From the API docs:Here’s the example: