OSDN Git Service

t#:
[pettanr/pettanr.git] / app / models / speech_balloon.rb
index a16dc95..6ca04cd 100644 (file)
@@ -125,13 +125,13 @@ class SpeechBalloon < ActiveRecord::Base
     {:include => {:panel => {:include => {:author => {} }}, :balloon => {}, :speech => {}, :speech_balloon_template => {} }}
   end
   
-  def store au
+  def store au, attr
     if self.new_record?
-      self.panel.speech_balloons.build(self.attributes)
+      sb = self.panel.speech_balloons.build
+      sb.attributes = attr
     else
       self.panel.speech_balloons.each do |speech_balloon|
         next unless speech_balloon == self
-        attr = self.attributes
         attr.delete 'id'
         speech_balloon.attributes = attr
         break