Sha256: c82eece3855ec5d51e78c6c8061d5083038f4392e721be6d4acd89422ec23df7

Contents?: true

Size: 700 Bytes

Versions: 22

Compression:

Stored size: 700 Bytes

Contents

# encoding: utf-8

module WorldDb
  module Model

  class Country
    has_many :teams,          class_name: 'SportDb::Model::Team',   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

22 entries across 22 versions & 1 rubygems

Version Path
sportdb-1.8.28 lib/sportdb/models/world/country.rb
sportdb-1.8.27 lib/sportdb/models/world/country.rb
sportdb-1.8.26 lib/sportdb/models/world/country.rb
sportdb-1.8.25 lib/sportdb/models/world/country.rb
sportdb-1.8.24 lib/sportdb/models/world/country.rb
sportdb-1.8.23 lib/sportdb/models/world/country.rb
sportdb-1.8.22 lib/sportdb/models/world/country.rb
sportdb-1.8.21 lib/sportdb/models/world/country.rb
sportdb-1.8.20 lib/sportdb/models/world/country.rb
sportdb-1.8.19 lib/sportdb/models/world/country.rb
sportdb-1.8.18 lib/sportdb/models/world/country.rb
sportdb-1.8.17 lib/sportdb/models/world/country.rb
sportdb-1.8.16 lib/sportdb/models/world/country.rb
sportdb-1.8.15 lib/sportdb/models/world/country.rb
sportdb-1.8.14 lib/sportdb/models/world/country.rb
sportdb-1.8.13 lib/sportdb/models/world/country.rb
sportdb-1.8.12 lib/sportdb/models/world/country.rb
sportdb-1.8.11 lib/sportdb/models/world/country.rb
sportdb-1.8.10 lib/sportdb/models/world/country.rb
sportdb-1.8.9 lib/sportdb/models/world/country.rb