Project

General

Profile

Download (726 Bytes) Statistics
| Branch: | Tag: | Revision:
b689e231 Marc Dequènes (Duck)
class ArtworkStepImage < ArtworkStep
has_many :artwork_step_thumbnails, :foreign_key => 'parent_id'

has_attachment :content_type => :image,
:max_size => MyCyma::Config.instance.max_uploaded_image_size_mb.megabyte,
:storage => :file_system,
:path_prefix => base_upload_path(),
:thumbnails => MyCyma::Config.instance.thumbnail_param_list,
:thumbnail_class => ArtworkStepThumbnail

validates_presence_of :filename, :date, :artwork_id #, :void
validates_uniqueness_of :filename, :scope => :artwork_id
validates_as_attachment

public :after_process_attachment
attr_accessor :saved_attachment
5c004100 Marc Dequènes (Duck)
def thumbnail(size)
self.artwork_step_thumbnails.find_by_thumbnail(size.to_s)
end
b689e231 Marc Dequènes (Duck)
end