Sha256: a68b3a0a0c54a890292ae208ae94c588a64896428d7870a6c8e41052f5ad864b

Contents?: true

Size: 781 Bytes

Versions: 49

Compression:

Stored size: 781 Bytes

Contents

# encoding: utf-8

module WorldDb
  module Model

  class Country
    has_many :teams,   class_name: 'SportDb::Model::Team',   foreign_key: 'country_id'
    has_one  :assoc,   class_name: 'SportDb::Model::Assoc',  foreign_key: 'country_id'

    # fix: require active record 4
    # has_many :clubs,           -> { where club: true },  class_name: 'SportDb::Model::Team',   foreign_key: 'country_id'
    # has_many :national_teams,  -> { where club: false }, class_name: 'SportDb::Model::Team',   foreign_key: 'country_id'

    has_many :leagues, class_name: 'SportDb::Model::League', foreign_key: 'country_id'
    has_many :grounds, class_name: 'SportDb::Model::Ground', foreign_key: 'country_id'
  end # class Country

  end # module Model
end # module WorldDb

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
sportdb-models-2.1.0 lib/sportdb/models/models/world/country.rb
sportdb-models-2.0.3 lib/sportdb/models/models/world/country.rb
sportdb-models-2.0.2 lib/sportdb/models/models/world/country.rb
sportdb-models-2.0.1 lib/sportdb/models/models/world/country.rb
sportdb-models-2.0.0 lib/sportdb/models/models/world/country.rb
sportdb-models-1.19.1 lib/sportdb/models/world/country.rb
sportdb-models-1.19.0 lib/sportdb/models/world/country.rb
sportdb-models-1.18.6 lib/sportdb/models/world/country.rb
sportdb-models-1.18.5 lib/sportdb/models/world/country.rb
sportdb-models-1.18.4 lib/sportdb/models/world/country.rb
sportdb-models-1.18.3 lib/sportdb/models/world/country.rb
sportdb-models-1.18.2 lib/sportdb/models/world/country.rb
sportdb-models-1.18.1 lib/sportdb/models/world/country.rb
sportdb-models-1.18.0 lib/sportdb/models/world/country.rb
sportdb-models-1.17.0 lib/sportdb/models/world/country.rb
sportdb-models-1.16.2 lib/sportdb/models/world/country.rb
sportdb-models-1.16.1 lib/sportdb/models/world/country.rb
sportdb-models-1.16.0 lib/sportdb/models/world/country.rb
sportdb-models-1.15.2 lib/sportdb/models/world/country.rb
sportdb-models-1.15.1 lib/sportdb/models/world/country.rb