On Sun, Apr 8, 2012 at 3:34 AM, Aashish Kiran
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> There are 2 models ''user'' and
''interests''
> Association between them is has_and_belongs_to_many
>
> Now If I want to list common interests between two users. How do I query
> db.
> I think, we have to write custom plsql statement.
?! user1.interests and user2.interests are just arrays.
You don''t need a SQL statement to figure out the intersection of two
arrays. :-)
--
Hassan Schroeder ------------------------
hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
http://about.me/hassanschroeder
twitter: @hassan
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.