X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fmodels%2Fresource_picture.rb;h=773c4c3258005881991b877789110a2faafa63ad;hb=467daaf74bbf62a7ad43d7af7fd6326bfacd9010;hp=4c02cc14eeab690045abb996bae6f2c5a0267c44;hpb=63ecce87bad492d32f35eff334989bf2c1b60f64;p=pettanr%2Fpettanr.git diff --git a/app/models/resource_picture.rb b/app/models/resource_picture.rb index 4c02cc14..773c4c32 100644 --- a/app/models/resource_picture.rb +++ b/app/models/resource_picture.rb @@ -16,16 +16,19 @@ class ResourcePicture < Peta::Content 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