X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/e7bff908a0ea52b62e4fa0dc13be0293a51dcbb1..83a39529b634c0344a7884d5813e3f7e1a7dbcb4:/app/models/quick_vote.rb diff --git a/app/models/quick_vote.rb b/app/models/quick_vote.rb index de78813..f9e1b83 100644 --- a/app/models/quick_vote.rb +++ b/app/models/quick_vote.rb @@ -1,6 +1,5 @@ class QuickVote < Election before_validation :build_candidate_names - after_validation :create_candidates validates_uniqueness_of :name attr_accessor :candidate_names @@ -60,8 +59,8 @@ class QuickVote < Election def build_candidate_names @candidate_names ||= [] - if @candidate_names.empty? and not candidates.empty? - @candidate_names = candidates.collect {|c| c.name} + if @candidate_names.empty? and not self.candidates.empty? + @candidate_names = self.candidates.collect {|c| c.name} end end