validates :z, :presence => true, :numericality => {:greater_than => 0}
validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
- 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
end
def filename
- self.picture.filename + '?subdir=' + self.flip
+ q = self.flip.empty? ? '' : '?subdir=' + self.flip
+ self.picture.filename + q
end
def url
end
def opt_div_style
- "top:#{self._y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
+ "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
end
def opt_img_tag spot = nil, opacity = 20
self.picture.symbol_option
end
- def self.public_list_where
+ def self.public_list_where list
'panels.publish > 0'
end