Class: Kms::AssetUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Kms::AssetUploader
- Defined in:
- app/uploaders/kms/asset_uploader.rb
Instance Method Summary collapse
- #save_content_type_in_model ⇒ Object
-
#store_dir ⇒ Object
Override the directory where uploaded files will be stored.
Instance Method Details
#save_content_type_in_model ⇒ Object
43 44 45 |
# File 'app/uploaders/kms/asset_uploader.rb', line 43 def save_content_type_in_model model.content_type = file.content_type if file.content_type end |
#store_dir ⇒ Object
Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted:
16 17 18 |
# File 'app/uploaders/kms/asset_uploader.rb', line 16 def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end |