Class: ImageUploader
- Inherits:
-
FileUploader
- Object
- CarrierWave::Uploader::Base
- FileUploader
- ImageUploader
- Includes:
- CarrierWave::MiniMagick
- Defined in:
- mod/05_standard/lib/image_uploader.rb
Instance Attribute Summary
Attributes inherited from FileUploader
Instance Method Summary collapse
-
#full_filename(for_file) ⇒ Object
add ‘original’ if no version is given.
- #identifier ⇒ Object
- #path(version = nil) ⇒ Object
Methods inherited from FileUploader
#action_id, #cache_dir, #create_versions?, #db_content, #extension, #file_dir, #filename, #mod_file?, #original_filename, #retrieve_dir, #retrieve_path, #store_dir, #store_path, #tmp_path, #url, #url_filename
Methods included from Card::Location
#card_path, #card_url, #page_path
Instance Method Details
#full_filename(for_file) ⇒ Object
add ‘original’ if no version is given
28 29 30 31 32 33 34 35 36 |
# File 'mod/05_standard/lib/image_uploader.rb', line 28 def full_filename for_file name = super(for_file) if version_name name else parts = name.split '.' "#{parts.shift}-original.#{parts.join('.')}" end end |
#identifier ⇒ Object
23 24 25 |
# File 'mod/05_standard/lib/image_uploader.rb', line 23 def identifier full_filename(super()) end |
#path(version = nil) ⇒ Object
6 7 8 |
# File 'mod/05_standard/lib/image_uploader.rb', line 6 def path version=nil (version && version != :original) ? versions[version].path : super() end |