Well, I imagine you could, as long as all of your models had a key in
common. I mean, there's no practical difference between vanilla Rails
and this:
default_scope order('id ASC')
But if all of your models had a :position maybe you could do this
default_scope order('position ASC')
and see what happens. I have my doubts -- everything Controller-wise
inherits from ApplicationController, and what about controllers that
don't just manage one model? This sort of thing has got to end badly
is my guess.
Walter
On Feb 1, 2011, at 10:15 PM, slava wrote:
I know I can set default_scope for individual active record model, but
can I set one up for the whole application?
thanks
--
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-
t...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.