mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-28 13:31:06 +00:00
18 lines
310 B
Ruby
18 lines
310 B
Ruby
|
class GatherMap < ActiveRecord::Base
|
||
|
scope :ordered, :order => "votes DESC, id DESC"
|
||
|
|
||
|
belongs_to :gather
|
||
|
belongs_to :map
|
||
|
has_many :real_votes, :class_name => "Vote", :as => :votable
|
||
|
|
||
|
before_create :init_variables
|
||
|
|
||
|
def to_s
|
||
|
self.map.to_s
|
||
|
end
|
||
|
|
||
|
def init_variables
|
||
|
self.votes = 0
|
||
|
end
|
||
|
end
|