Commit 8162c80735da8a947a48c31f1812b6258b89900e
1 parent
b78b0dcc
Exists in
master
and in
1 other branch
quick refactor
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/models/choice.rb
| @@ -71,9 +71,9 @@ class Choice < ActiveRecord::Base | @@ -71,9 +71,9 @@ class Choice < ActiveRecord::Base | ||
| 71 | #do this in a new process (via delayed jobs) | 71 | #do this in a new process (via delayed jobs) |
| 72 | previous_choices = (self.question.choices - [self]) | 72 | previous_choices = (self.question.choices - [self]) |
| 73 | return if previous_choices.empty? | 73 | return if previous_choices.empty? |
| 74 | - for c in previous_choices | 74 | + previous_choices.each { |c| |
| 75 | question.prompts.create!(:left_choice => c, :right_choice => self) | 75 | question.prompts.create!(:left_choice => c, :right_choice => self) |
| 76 | question.prompts.create!(:left_choice => self, :right_choice => c) | 76 | question.prompts.create!(:left_choice => self, :right_choice => c) |
| 77 | - end | 77 | + } |
| 78 | end | 78 | end |
| 79 | end | 79 | end |