mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 13:01:02 +00:00
16 lines
276 B
Ruby
16 lines
276 B
Ruby
|
class GatherServer < ActiveRecord::Base
|
||
|
scope :ordered, :order => "votes DESC"
|
||
|
|
||
|
belongs_to :gather
|
||
|
belongs_to :server
|
||
|
has_many :real_votes, :class_name => "Vote", :as => :votable
|
||
|
|
||
|
def to_s
|
||
|
self.server.to_s
|
||
|
end
|
||
|
|
||
|
def before_create
|
||
|
self.votes = 0
|
||
|
end
|
||
|
end
|