engine/app/uploaders/asset_uploader.rb

28 lines
604 B
Ruby
Raw Normal View History

2010-05-12 00:16:39 +00:00
# encoding: utf-8
class AssetUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
include Locomotive::CarrierWave::Uploader::Asset
version :thumb, :if => :image? do
2010-05-12 00:16:39 +00:00
process :resize_to_fill => [50, 50]
process :convert => 'png'
end
version :medium, :if => :image? do
2010-05-12 00:16:39 +00:00
process :resize_to_fill => [80, 80]
process :convert => 'png'
end
version :preview, :if => :image? do
2010-05-12 00:16:39 +00:00
process :resize_to_fit => [880, 1100]
process :convert => 'png'
2010-05-12 00:16:39 +00:00
end
def store_dir
self.build_store_dir('sites', model.collection.site_id, 'assets', model.id)
end
2010-05-12 00:16:39 +00:00
end