12

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.

3 Answers3

19

default_scope is available in Rails 3.0, see the following

Patrick Klingemann
  • 8,884
  • 4
  • 44
  • 51
4

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

webmat
  • 58,466
  • 12
  • 54
  • 59
  • 3
    in rails 3.2 this is the method http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Default/ClassMethods.html#method-i-default_scope – Orlando Jun 24 '12 at 19:30
0

default_scope where(:abc => val)

ssedano
  • 8,322
  • 9
  • 60
  • 98
AMBasra
  • 969
  • 8
  • 24