Sha256: 6fd57338cb0d1b9990eb9398b42f092bec3f1f90bb1d4db20328ba736d53686e

Contents?: true

Size: 754 Bytes

Versions: 4

Compression:

Stored size: 754 Bytes

Contents

# encoding: utf-8

module SportDb
  module Model


class EventStanding < ActiveRecord::Base

  self.table_name = 'event_standings'

  has_many   :entries, class_name: 'SportDb::Model::EventStandingEntry', foreign_key: 'event_standing_id', :dependent => :delete_all
  belongs_to :event

end # class EventStanding


class EventStandingEntry < ActiveRecord::Base

  self.table_name = 'event_standing_entries'

  belongs_to :standing, class_name: 'SportDb::Model::EventStanding', foreign_key: 'event_standing_id'
  belongs_to :team

  ## note:
  ##  map standing_id to group_standing_id - convenience alias
  def standing_id=(value)  write_attribute(:event_standing_id, value);  end

end # class EventStandingEntry

  end # module Model
end # module SportDb

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sportdb-models-2.1.0 lib/sportdb/models/models/stats/event_standing.rb
sportdb-models-2.0.2 lib/sportdb/models/models/stats/event_standing.rb
sportdb-models-2.0.1 lib/sportdb/models/models/stats/event_standing.rb
sportdb-models-2.0.0 lib/sportdb/models/models/stats/event_standing.rb