Class: CandidateVote

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

Instance Method Summary collapse

Instance Method Details

#nameObject



5
6
7
# File 'app/models/candidate_vote.rb', line 5

def name
  candidate && candidate.name
end

#tampered?(office) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/candidate_vote.rb', line 13

def tampered?(office)
  !candidate || candidate.office != office
end

#voteObject



9
10
11
# File 'app/models/candidate_vote.rb', line 9

def vote
  self.voted = true
end