Im trying to get all the @participants where gender is male or female. I have just surfaced AR and now digging into all the possibility's more but find it hard to get this query done.
- user (user_id) has_profile
- profile belongs_to user
- participants (participant_id) belongs_to user, profile
Im trying to get all the participants with participant_id where in there profile ( user_id ) they have gender = 'male' or 'female'
What would be the best shortest way to get the @participants_male filled with the results?
Im not sure how to get it out of the relations with the where statement, anyone could help me in the right direction? thx!
@participants_male = Participant.where(