Class: Lanes::Concerns::AssetUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Lanes::Concerns::AssetUploader
- Includes:
- CarrierWave::MiniMagick
- Defined in:
- lib/lanes/concerns/asset_uploader.rb
Instance Method Summary collapse
Instance Method Details
#cache_dir ⇒ Object
21 22 23 |
# File 'lib/lanes/concerns/asset_uploader.rb', line 21 def cache_dir '/tmp' end |
#filename ⇒ Object
25 26 27 28 29 |
# File 'lib/lanes/concerns/asset_uploader.rb', line 25 def filename if original_filename && model && model.read_attribute(mounted_as).present? model.read_attribute(mounted_as) end end |
#store_dir ⇒ Object
31 32 33 34 |
# File 'lib/lanes/concerns/asset_uploader.rb', line 31 def store_dir token = secure_token "#{token[0, 2]}/#{token[2, 2]}" end |