I have a model called game which "belongs_to"i.e one-to-many relationship with sport model and also has "belongs_to" i.e one-to-many relationshio with a league model. Now how can i get the leagues for a particular sport using the relationship.
sport->(hasmany)->games
league ->(hasmany) --> games
how can i get the leagues for a particular sport
Aucun commentaire:
Enregistrer un commentaire