OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / models / ground_picture.rb
index 1f303ec..ab5a244 100644 (file)
@@ -13,7 +13,20 @@ class GroundPicture < Peta::Element
   
   @@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
   
-  def _y
+  def self.pickup_item_name
+    Picture.item_name
+  end
+  
+  def self.pickup_column_name
+    self.pickup_item_name + '_id'
+  end
+  
+  def pickup_id
+    # get :picture_id if head revision
+    self.attributes[self.pickup_column_name]
+  end
+  
+  def y
     self.attributes['y']
   end
   
@@ -48,7 +61,7 @@ class GroundPicture < Peta::Element
       'position' => 'absolute', 'top' => '0px', 'left' => '0px', 'z-index' => self.z, 
       'background-image' => "url(#{self.picture.url})", 
       'background-repeat' => self.repeat_text, 
-      'background-position' => "#{self.x}px #{self._y}px"
+      'background-position' => "#{self.x}px #{self.y}px"
     }
     self.merge_opacity(r, opacity) if spot and spot != self
     r
@@ -67,7 +80,7 @@ class GroundPicture < Peta::Element
     @@repeat_texts[self.repeat]
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end