I'm playing with the new (well, to me) scopes in rails 3. I can see
where one could use a lot of scoping rules in conjunction with one or
two simple associations to get rid of a lot of specific custom
association definitions. In use:
some_library.musty_books ("has_many :books", "has_many :musty_books,
:conditions....")
becomes
some_library.books.musty ("has_many :books", "scope :musty_books, where...")
My question is, is Arel and the scoping considered "here to stay"? Is
it more or less likely than the good-old associations to become
deprecated, like some of the Active Record finder code did between 2
and 3?
In situations where either might work, what's considered safer form,
"has_many XX, :conditions" or "scope XX, where"? And does the answer
change if you're using :through, arel's joins() and merge, etc?
Thanks much...
-glenn
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby