Using scopes with has_many and belongs_to
When you have a belongs_to or a has_one/has_many (with or without :through) association defined on your model, you will in many situations benefit from defining scopes in your model that reference your association. Check out this article for more, and hope you enjoy!
Post a comment