Sha256: 45f433e4355a8a6a8809a371a22f7027b83cfe1f191fd92c8e3cf2104ac12948

Contents?: true

Size: 785 Bytes

Versions: 5

Compression:

Stored size: 785 Bytes

Contents

# encoding: utf-8

module SportDb
  module Model


class GroupStanding < ActiveRecord::Base

  self.table_name = 'group_standings'

  has_many   :entries, class_name: 'SportDb::Model::GroupStandingEntry', foreign_key: 'group_standing_id', :dependent => :delete_all
  belongs_to :group

end # class GroupStanding


class GroupStandingEntry < ActiveRecord::Base

  self.table_name = 'group_standing_entries'

  belongs_to :standing, class_name: 'SportDb::Model::GroupStanding', foreign_key: 'group_standing_id'
  belongs_to :team

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

end # class GroupStandingEntry

  end # module Model
end # module SportDb

Version data entries

5 entries across 5 versions & 1 rubygems

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