validates :license_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :original_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
- validates :artist_name, :presence => true
validates :license_group_module_name, :presence => true, :length => {:maximum => 50}
validates :picture_id, :presence => true, :numericality => true, :existence => {:both => false}
+ validates :license_settings, :boost => {:boost_name => :license}
+ validates :license_group_settings, :boost => {:boost_name => :license_group}
+ validates :credit_picture_settings, :boost => {:boost_name => :credit_picture}
def supply_default
end
def overwrite op
attr = {:width => op.width, :height => op.height, :ext => op.ext, :filesize => op.filesize,
- :original_picture_id => op.id, :artist_id => op.artist_id, :md5 => op.md5
+ :original_picture_id => op.id, :artist_id => op.artist_id, :md5 => op.md5,
+ :created_at => Time.now, :updated_at => Time.now
}
self.attributes = attr
end