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
14 15 16 |
# File 'app/uploaders/shoppe/attachment_uploader.rb', line 14 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
19 20 21 |
# File 'app/uploaders/shoppe/attachment_uploader.rb', line 19 def not_image?(new_file) !self.file.content_type.include? 'image' end |
#store_dir ⇒ Object
Where should files be stored?
9 10 11 |
# File 'app/uploaders/shoppe/attachment_uploader.rb', line 9 def store_dir "attachment/#{model.id}" end |