I'm working on a rails project where I have a User, that has_many Teams through a Membership model. The User has a privacy setting which can be (public, private or protected)
On the current user's homepage, I want to display all of the users who have their profiles set to public, but also the users who have their profile set to protected and share a team with the current user.
I could do this as two separate queries and then combine the resulting arrays but I'm assuming it's 'better' to keep it as one - I think it will also then behave better with will_paginate.
I thought I might need to use Arel because of the .or condition but just can't get my head around the joins needed to work out shared teams.
I'm new to AREL, SQL and Stackoverflow for that matter, so apologies if this doesn't make much sense.