box-o-sand/map-mash/app/models/mash.rb

14 lines
417 B
Ruby
Raw Normal View History

2012-03-04 16:51:35 +00:00
class Mash < ActiveRecord::Base
belongs_to :map_a, :class_name => 'Map'
belongs_to :map_b, :class_name => 'Map'
belongs_to :winner, :class_name => 'Map'
has_one :tournament, :class_name => 'MashTournament'
has_one :round, :class_name => 'MashTournamentRound'
named_scope :unplayed, :conditions => [%{
winner_id IS NULL
AND map_a_id IS NOT NULL
AND map_b_id IS NOT NULL
}]
2012-03-04 16:51:35 +00:00
end