Sha256: bd9858a7babe133b96db1ceb5748fdc45f36551a0d346fb01ac776ce580b3297

Contents?: true

Size: 663 Bytes

Versions: 5

Compression:

Stored size: 663 Bytes

Contents

# encoding: utf-8


module WorldDb
  module Model

  class City
    has_many :teams,   class_name: 'SportDb::Model::Team',   foreign_key: 'city_id'

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


    has_many :grounds, class_name: 'SportDb::Model::Ground', foreign_key: 'city_id'
    has_many :matches, class_name: 'SportDb::Model::Match',  :through => :grounds
  end

  end # module Model
end # module WorldDb

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sportdb-models-2.1.0 lib/sportdb/models/models/world/city.rb
sportdb-models-2.0.3 lib/sportdb/models/models/world/city.rb
sportdb-models-2.0.2 lib/sportdb/models/models/world/city.rb
sportdb-models-2.0.1 lib/sportdb/models/models/world/city.rb
sportdb-models-2.0.0 lib/sportdb/models/models/world/city.rb