lib/sportdb/models/city.rb in sportdb-0.5.1 vs lib/sportdb/models/city.rb in sportdb-0.5.2
- old
+ new
@@ -2,9 +2,12 @@
class City < ActiveRecord::Base
self.table_name = 'cities'
belongs_to :country, :class_name => 'Country', :foreign_key => 'country_id'
+
+ has_many :teams, :class_name => 'Team', :foreign_key => 'city_id'
+
def self.create_from_ary!( cities, more_values={} )
cities.each do |values|
## todo/fix: split optional synonyms from title (see team for example)
\ No newline at end of file