default_scope in rails 3
-
24-09-2019 - |
Question
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.
Solution
default_scope is available in Rails 3.0, see the following
- Lighthouse Ticket referencing default_scope in Rails 3.0
- Github Rails 3.0 scope code
- Railscast about scope in Rails 3.0
OTHER TIPS
Here's another pointer: the api doc for AR::Base.default_scope
default_scope where(:abc => val)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow