load_manifest
belongs_to :original_picture
belongs_to :license
+ belongs_to :system_picture
belongs_to :artist
has_one :resource_picture
validates :filesize, :presence => true, :numericality => {:greater_than => 0, :less_than_or_equal_to => 2000000}, :natural_number => true
validates :md5, :presence => true, :length => {:minimum => 32, :maximum => 32}
validates :license_id, :presence => true, :numericality => true, :existence => {:both => false}
+ validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :artist_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :artist_name, :presence => true
validates :license_group_classname, :presence => true, :length => {:maximum => 50}
def overwrite rp
attr = {:width => rp.width, :height => rp.height, :ext => rp.ext, :filesize => rp.filesize,
- :original_picture_id => rp.original_picture_id, :license_id => rp.license_id, :artist_id => rp.artist_id,
+ :original_picture_id => rp.original_picture_id, :license_id => rp.license_id,
+ :system_picture_id => rp.system_picture_id, :artist_id => rp.artist_id,
:md5 => rp.md5, :artist_name => rp.artist_name,
:license_group_classname => rp.license_group_classname,
:license_group_settings => rp.license_group_settings,
{:src => img, :width => tw, :height => th}
end
+ def alt_name
+ self.license.license_group.caption.to_s + '[' + self.license.caption.to_s + ']'
+ end
+
def symbol_option
self.tmb_opt_img_tag
end