Hi all,

I'm struggling to find any arel docs that cover anything but the most basic
of joins.

I have users and boards, with a memberships join table (memberships has
user_id and board_id FKs). So,

    User <--->> Membership <<---> Board

For a given user, I want to select all memberships on boards to which this
user has a membership. So, a slow 2-query version of what I want is

    Membership.where(:board_id => current_user.boards.map(&:id))

Can someone drop some arel knowledge on me?

ben_h

-- 
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