开发者

default_scope in rails 3

开发者 https://www.devze.com 2022-12-25 06:16 出处:网络
I k开发者_如何学编程now 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.default_scope is ava

I k开发者_如何学编程now 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.


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


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


default_scope where(:abc => val)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号