load_manifest
belongs_to :artist
belongs_to :license
+ belongs_to :system_picture
belongs_to :picture
belongs_to :original_picture
validates :md5, :presence => true, :length => {:minimum => 32, :maximum => 32}
validates :artist_id, :presence => true, :numericality => true, :existence => {:both => false}
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_classname, :presence => true, :length => {:maximum => 50}
end
def visible? operators
- return false unless super
- true
+ # no super
+ # content model call to owner checker
+ self.user_visible? operators
end
def filename
end
def url subdir = nil
- '/resource_pictures/' + (subdir.to_s.empty? ? '' : subdir.to_s + '/' ) + filename
+ '/resource_pictures/' + filename + (subdir.to_s.empty? ? '' : '?subdir=' + subdir.to_s)
end
def to_gif?
{:src => self.url('full'), :width => self.width, :height => self.height}
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
pc = Picture.new
pc.supply_default
pc.overwrite self
+ pc.boosts 'post'
r = pc.store imager
return pc if r
self.errors.add :base, Picture.model_name.human + I18n.t('errors.not_create')