Class: BcmsPolling::Poll

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/bcms_polling/poll.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



16
17
18
# File 'app/models/bcms_polling/poll.rb', line 16

def name
  question
end

#total_votesObject



12
13
14
# File 'app/models/bcms_polling/poll.rb', line 12

def total_votes
  self.responses.inject(0) { |sum, r| sum += r.votes }
end