I have three models: Wager, Race, RaceCard and WagerType. I\'ve created a has_many association in Wagers and have added a custom association method (in_wager). The purpose
Do you absolutely need to use an has_many relation ? maybe you could just create a method in the Wager class
def races
b = self.race_nbr
a = b + self.race_card.legs
Races.find_by_race_card_id(self.id).where('race_nbr BETWEEN ? AND ?', a, b)
end
I don't really understand your model, so the request is certainly wrong, but you get the idea...