engine/app/uploaders/theme_asset_uploader.rb

22 lines
447 B
Ruby
Raw Normal View History

2010-05-11 21:38:52 +00:00
# encoding: utf-8
class ThemeAssetUploader < AssetUploader
process :set_content_type
2010-05-11 21:38:52 +00:00
process :set_size
process :set_width_and_height
def store_dir
2010-10-14 14:01:18 +00:00
File.join('sites', (model.site_id_was || model.site_id).to_s, 'theme', model.folder_was || model.folder)
2010-10-10 14:37:34 +00:00
end
2010-10-10 14:37:34 +00:00
def stale_model?
!model.new_record? && model.folder_changed?
2010-05-11 21:38:52 +00:00
end
2010-05-11 21:38:52 +00:00
def extension_white_list
%w(jpg jpeg gif png css js swf flv eot svg ttf woff otf)
2010-05-11 21:38:52 +00:00
end
end