Good morning,
I have a quick joins-related question:
I have a a list of followings (User following another user''s activity)
which basically have these followed users'' ids under
''followable_id''.
now what I want to do and finally have is to take these followed users
and check what activities they have. each activity has a .user_id. how
would I do this?
So Basically
A User is following X other Users (polymorphic intermediate model... a
User can also follow discussions etc). Each of those users has a set
of activities.
What I basically want in a ''speedy'' way is to get all followed
users''
activities.
I kinda have a problem with the polymorphism of the Follow model, as
apparently I cannot put a has_many relationship into the user model
which would allow me a condition (followable_type = "User"), class
(User) and source (:followable)...
I am kinda lost.. been wrangling with join conditions all night :-/
Any ideas / suggestions? Would be highly, highly appreciated...!
Cheers,
-Joerg
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---