default_scope in rails 3
Asked Answered
C

3

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.

Chen answered 2/4, 2010 at 21:34 Comment(0)
O
19

default_scope is available in Rails 3.0, see the following

Outskirts answered 3/4, 2010 at 2:47 Comment(2)
Is default_scope going to remain in rails3? It won't be deprecated in coming versions?Razid
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.Outskirts
B
4

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

Breger answered 8/6, 2011 at 20:30 Comment(1)
in rails 3.2 this is the method api.rubyonrails.org/classes/ActiveRecord/Scoping/Default/…Compeer
H
0

default_scope where(:abc => val)

Heterocercal answered 17/1, 2014 at 20:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.