Rails 4 default scope

前端 未结 8 2096
萌比男神i
萌比男神i 2020-12-04 15:21

In my Rails app have a default scope that looks like this:

default_scope order: \'external_updated_at DESC\'

I have now upgraded to Rails 4

8条回答
  •  [愿得一人]
    2020-12-04 16:06

    This worked from me (just for illustration with a where) because I came to this topic via the same problem.

    default_scope { where(form: "WorkExperience") }
    

提交回复
热议问题