OSDN Git Service

fix editor
[pettanr/pettanr.git] / app / models / speech.rb
index 076c80d..b780aa7 100644 (file)
@@ -17,7 +17,7 @@ class Speech < Peta::Element
   validates :width, :presence => true, :numericality => true, :natural_number => true
   validates :height, :presence => true, :numericality => true, :natural_number => true
   validates :quotes, :length => {:maximum => 15}, :quotes_even => true
-  validates :speech_balloon_template_settings, :boost => {:resource_name => :speech_balloon_template}
+  validates :speech_balloon_template_settings, :boost => {:boost_name => :speech_balloon_template}
   #validates :writing_format_settings
   
   @@text_align_texts = ['left', 'left', 'right', 'center']
@@ -35,7 +35,7 @@ class Speech < Peta::Element
   
   def outer_style
     {
-      'top' => self.y, 'left' => self.x, 
+      'top' => self._y, 'left' => self.x, 
       'width' => self.width, 'height' => self.height
     }
   end
@@ -56,10 +56,6 @@ class Speech < Peta::Element
     'panels.publish > 0'
   end
   
-  def self.list_order
-    'speeches.updated_at desc'
-  end
-  
   def self.by_author_list_includes
     {
       :speech_balloon => {
@@ -70,31 +66,10 @@ class Speech < Peta::Element
     }
   end
   
-  def self.list_opt
-    {:speech_balloon => {:panel => {:author => {}}, :balloon => {}, :speech_balloon_template => {}} }
-  end
-  
-  def self.list_json_opt
-    {:include => {:speech_balloon => {:include => {:panel => {:include => {:author => {} }}, :balloon => {}, :speech_balloon_template => {} }}}}
-  end
-  
   def self.show_opt
     {:include => {:speech_balloon => {:panel => {:author => {}}, :balloon => {}, :speech_balloon_template => {} }}}
   end
   
-  def self.show_json_opt
-    {:include => {:speech_balloon => {:include => {:panel => {:include => {:author => {} }}, :balloon => {}, :speech_balloon_template => {} }}}}
-  end
-  
-  def copy_attributes
-    r = self.attributes
-    r.delete 'id'
-    r.delete 'speech_balloon_id'
-    r.delete 'created_at'
-    r.delete 'updated_at'
-    r
-  end
-  
   def self.panelize speech_attributes
     {'speech_attributes' => speech_attributes}
   end