is it possible to have an active record has_many associations, but i have a specific condition.
class Team < AR
has_many :matches, query: 'team1 == ID or team2 == ID'
end
class Match < AR
attr_accessible :team1, :team2
end
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a potential solution: