public
Description: A generic voting app that hooks into faces.rubyonrails.com.au so members can vote with their IRC Nicks. #crc
Homepage:
Clone URL: git://github.com/artpop/roro-vote.git
roro-vote / app / models / topic.rb
100644 17 lines (11 sloc) 0.315 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Topic < ActiveRecord::Base
  
  has_many :choices
  has_many :votes
  
  validates_presence_of :name, :description
  
  def paged_votes(page)
    votes.paginate :order => 'votes.created_at DESC', :page => page, :per_page => 7, :include => :choice
  end
  
  def disable!
    self.enabled = false
  end
  
end