Class: Shoppe::AttachmentUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Shoppe::AttachmentUploader
- Includes:
- CarrierWave::MiniMagick
- Defined in:
- app/uploaders/shoppe/attachment_uploader.rb
Instance Method Summary collapse
-
#image?(new_file) ⇒ Boolean
Returns true if the file is an image.
-
#not_image?(new_file) ⇒ Boolean
Returns true if the file is not an image.
-
#store_dir ⇒ Object
Where should files be stored?.
Instance Method Details
#image?(new_file) ⇒ Boolean
Returns true if the file is an image
15 16 17 |
# File 'app/uploaders/shoppe/attachment_uploader.rb', line 15 def image?(new_file) self.file.content_type.include? 'image' end |
#not_image?(new_file) ⇒ Boolean
Returns true if the file is not an image
20 21 22 |
# File 'app/uploaders/shoppe/attachment_uploader.rb', line 20 def not_image?(new_file) !self.file.content_type.include? 'image' end |
#store_dir ⇒ Object
Where should files be stored?
10 11 12 |
# File 'app/uploaders/shoppe/attachment_uploader.rb', line 10 def store_dir "attachment/#{model.id}" end |