OSDN Git Service

t#31896:refact elm
[pettanr/pettanr.git] / app / models / ground_color.rb
index 0e27aba..7f1a3f0 100644 (file)
@@ -18,6 +18,14 @@ class GroundColor < ActiveRecord::Base
     end
   end
   
+  def self.colum_structures
+    @@colum_structures ||= {
+      :code => {
+        :helper => 'panels/color_helper'
+      }
+    }
+  end
+  
   def self.list_opt_for_panel
     {
       :ground_colors => {
@@ -68,42 +76,13 @@ class GroundColor < ActiveRecord::Base
     "position: absolute; width:#{self.get_panel.width}px; height:#{self.get_panel.height}px; z-index:#{self.z}; background-color:##{format("%06x", self.code)}; #{o}"
   end
   
-  def new_panel
-    @new_panel
-  end
-  
-  def new_panel= v
-    @new_panel = v
-  end
-  
-  def get_panel
-    self.panel || @new_panel
-  end
-  
-  def tag_id c = nil
-    'panel' + tag_panel_id + 'ground_color' + tag_element_id + c.to_s
-  end
-  
-  def field_tag_id f
-    self.tag_id + f.to_s
-  end
-  
-  def tag_panel_id
-    self.get_panel.new_record? ? '0' : self.get_panel.id.to_s
-  end
-  
-  def tag_element_id
-    self.new_record? ? '0' : self.id.to_s
+  def boost
   end
   
   def tag_element_type
     'ground_color'
   end
   
-  def field_tree f
-    'panels-' + self.tag_panel_id + '-ground_colors_attributes-' + self.tag_element_id + '-' + f.to_s
-  end
-  
   def self.default_page_size
     25
   end