Wrap text
|
|
class Photo < ActiveRecord::Base
has_attachment :content_type => :image,
:storage => :file_system,
:resize_to => '800x600>',
:thumbnails => { :thumb => '80x80>', :main => '375x375>'},
:processor => :rmagick
validates_as_attachment
def resize_image(img, size)
self.temp_path = write_to_temp_file(img.to_blob {self.quality = 30})
end
end
|