validates :z, :presence => true, :numericality => {:greater_than => 0}
validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
- def self.by_author_list_includes
- {
- :panel => {
- :author => {}
- }
- }
+ def self.pickup_item_name
+ Picture.item_name
end
- def self.list_opt_for_panel
- {
- :panel_pictures => {
- :picture => {:artist => {}, :license => {}}
- }
- }
+ def self.pickup_column_name
+ self.pickup_item_name + '_id'
end
- def self.show_opt_for_panel
- {
- :panel_pictures => {
- :picture => {:artist => {}, :license => {}}
- }
- }
+ def pickup_id
+ # get :picture_id if head revision
+ self.attributes[self.pickup_column_name]
end
- def self.json_opt_for_panel
+ def y
+ self.attributes['y']
+ end
+
+ def self.by_author_list_includes
{
- :picture => {:artist => {}, :license => {}}
+ :panel => {
+ :author => {}
+ }
}
end
{:include => {:panel => {:author => {}}, :picture => {:artist => {}, :license => {}}}}
end
- def self.show_json_opt
- {:include => {:panel => {:include => {:author => {}}}, :picture => {:include => {:artist => {}, :license => {}}} }}
- end
-
def scenario
if caption.blank?
''