I've had an activerecord problem that's been bugging me for a while. If you
have a has-many-through association, and have scopes defined on the
"through" model, is it possible to re-use the scopes in the definition of
the has-many-through? (without copying the where clause of the scope in the
has-many-through)

eg.

   - a -> b -> c
   - there is a "blah" scope on b
   - you'd like to define "a has many c's through b, where b.c"


I've already posted this on stackoverflow with a more full explanation and
example (but it's had a pretty lukewarm response)

http://stackoverflow.com/questions/13696045/reusing-activerecord-scopes-on-has-many-through-associations


Does anyone have any good suggestions about how to do this in a "DRY" way?


Iain

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to