Commit 29e218ba3949e63941c1cf60e5d930b82132fa70
1 parent
b730d749
Exists in
master
and in
1 other branch
denormalization of choice data
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/models/choice.rb
... | ... | @@ -14,7 +14,7 @@ class Choice < ActiveRecord::Base |
14 | 14 | has_many :prompts_on_the_right, :class_name => "Prompt", :foreign_key => "right_choice_id" |
15 | 15 | named_scope :active, :conditions => { :active => true } |
16 | 16 | |
17 | - attr_accessor :data | |
17 | + #attr_accessor :data | |
18 | 18 | |
19 | 19 | def question_name |
20 | 20 | question.name | ... | ... |
app/models/question.rb
... | ... | @@ -85,7 +85,7 @@ class Question < ActiveRecord::Base |
85 | 85 | the_ideas.each { |choice_text| |
86 | 86 | item = Item.create!({:data => choice_text, :creator => creator}) |
87 | 87 | puts item.inspect |
88 | - choice = choices.create!(:item => item, :creator => creator, :active => true) | |
88 | + choice = choices.create!(:item => item, :creator => creator, :active => true, :data => choice_text) | |
89 | 89 | puts choice.inspect |
90 | 90 | } |
91 | 91 | end | ... | ... |