Class: Locomotive::ThemeAssetUploader
Class Method Summary
collapse
Instance Method Summary
collapse
#find_content_type_of_model, #image?, #set_content_type_of_model, #set_size, #set_width_and_height
#build_store_dir, #to_label, #to_liquid
#download!
Class Method Details
.content_types ⇒ Object
24
25
26
27
28
29
|
# File 'app/uploaders/locomotive/theme_asset_uploader.rb', line 24
def self.content_types
list = super.clone
list.delete(:pdf)
list
end
|
Instance Method Details
#apply_content_type_exception(value) ⇒ Object
16
17
18
19
20
21
22
|
# File 'app/uploaders/locomotive/theme_asset_uploader.rb', line 16
def apply_content_type_exception(value)
if content_type == 'image/svg+xml' && model.folder.starts_with?('fonts')
:font
else
value
end
end
|
#extension_whitelist ⇒ Object
12
13
14
|
# File 'app/uploaders/locomotive/theme_asset_uploader.rb', line 12
def extension_whitelist
%w(jpg jpeg gif png css js swf flv mp4 eot svg svgz ttf ttc woff woff2 otf ico htc map html cur txt xml json ogv webm)
end
|
#store_dir ⇒ Object
8
9
10
|
# File 'app/uploaders/locomotive/theme_asset_uploader.rb', line 8
def store_dir
self.build_store_dir('sites', model.site_id, 'theme', model.folder)
end
|