How do you scope ActiveRecord associations in Rails 3?

后端 未结 6 1685
你的背包
你的背包 2021-01-30 01:21

I have a Rails 3 project. With Rails 3 came Arel and the ability to reuse one scope to build another. I am wondering if there is a way to use scopes when defining a relationsh

6条回答
  •  一整个雨季
    2021-01-30 02:12

    You can use merge method in order to merge scopes from different models. For more details search for merge in this railscast

提交回复
热议问题