diff --git a/app/controllers/prompts_controller.rb b/app/controllers/prompts_controller.rb index b0ae0aa..47e3439 100644 --- a/app/controllers/prompts_controller.rb +++ b/app/controllers/prompts_controller.rb @@ -60,7 +60,7 @@ class PromptsController < InheritedResources::Base raise "need to specify either ':left' or ':right' as a direction" end - @prompt.choices.each {|c| c.score = c.compute_score; c.save!} + @prompt.choices.each(&:compute_score!) respond_to do |format| if successful format.xml { render :xml => @question.picked_prompt.to_xml(:methods => [:left_choice_text, :right_choice_text, :left_choice_id, :right_choice_id]), :status => :ok } diff --git a/app/models/user.rb b/app/models/user.rb index 4cee134..72e0ab4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -32,7 +32,7 @@ class User < ActiveRecord::Base def record_vote(visitor_identifier, prompt, ordinality) visitor = visitors.find_or_create_by_identifier(visitor_identifier) visitor.vote_for!(prompt, ordinality) - prompt.choices.each {|c| c.score = c.compute_score; c.save!} + #prompt.choices.each {|c| c.compute_score; c.save!} end def record_skip(visitor_identifier, prompt) -- libgit2 0.21.2