OSDN Git Service

fix:new elm
[pettanr/pettanr.git] / app / models / ground_picture.rb
index 36461d3..ab5a244 100644 (file)
@@ -13,6 +13,23 @@ class GroundPicture < Peta::Element
   
   @@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
   
+  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
+  
   def self.by_author_list_includes
     {
       :panel => {
@@ -63,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