default_scope in rails 3

15,420

Solution 1

default_scope is available in Rails 3.0, see the following

Solution 2

Here's another pointer: the api doc for AR::Base.default_scope

Share:
15,420
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I know named_scope has been changed to scope in rails 3.

    How do I perform default_scope in rails 3, I've had a good google but found nothing for defaults scopes.

  • Jim Mitchener
    Jim Mitchener over 13 years
    Is default_scope going to remain in rails3? It won't be deprecated in coming versions?
  • Patrick Klingemann
    Patrick Klingemann over 13 years
    I use default_scope in a number of of Rails3 apps and I haven't seen a deprecation warning, so I assume it will remain.
  • Orlando
    Orlando almost 12 years