lib/sportdb/models/world/city.rb in sportdb-1.8.1 vs lib/sportdb/models/world/city.rb in sportdb-1.8.2
- old
+ new
@@ -3,10 +3,12 @@
## todo: how to best extends city model?
module WorldDb::Model
class City
- has_many :teams, class_name: 'SportDb::Model::Team', foreign_key: 'city_id'
+ has_many :teams, class_name: 'SportDb::Model::Team', foreign_key: 'city_id'
+ has_many :grounds, class_name: 'SportDb::Model::Ground', foreign_key: 'city_id'
+ has_many :games, :through => :grounds
end
end # module WorldDb::Model