Class: Spree::Upload
- Inherits:
-
Asset
- Object
- Asset
- Spree::Upload
- Defined in:
- app/models/spree/upload.rb
Instance Method Summary collapse
Instance Method Details
#attachment_sizes ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/models/spree/upload.rb', line 19 def if image_content? { :mini => '48x48>', :small => '150x150>', :medium => '420x300>', :large => '800x500>' } else {} end end |
#image_content? ⇒ Boolean
15 16 17 |
# File 'app/models/spree/upload.rb', line 15 def image_content? .match(/\/(jpeg|png|gif|tiff|x-photoshop)/) end |
#no_attachement_errors ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'app/models/spree/upload.rb', line 27 def no_attachement_errors if .blank? || !.errors.empty? # uncomment this to get rid of the less-than-useful interrim messages errors.clear errors.add :attachment, "Paperclip returned errors for file '#{}' - check ImageMagick installation or image source file." false end end |