lib/sportdb/models/country.rb in sportdb-0.5.3 vs lib/sportdb/models/country.rb in sportdb-0.5.4
- old
+ new
@@ -2,11 +2,13 @@
class Country < ActiveRecord::Base
self.table_name = 'countries'
- has_many :cities, :class_name => 'City', :foreign_key => 'country_id'
- has_many :teams, :class_name => 'Team', :foreign_key => 'country_id'
+ has_many :regions, :class_name => 'Region', :foreign_key => 'country_id'
+ has_many :cities, :class_name => 'City', :foreign_key => 'country_id'
+ has_many :teams, :class_name => 'Team', :foreign_key => 'country_id'
+ has_many :leagues, :class_name => 'League', :foreign_key => 'country_id'
def self.create_from_ary!( countries )
countries.each do |values|
## key & title required