Module: Transit::Model::Attachments
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/transit/model/attachments.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#files ⇒ Object
Convenience method for only finding the assets that are files.
- #image? ⇒ Boolean
-
#images ⇒ Object
Convenience method for only finding the assets that are images.
-
#preview_image_url ⇒ Object
Override to show a “default image” in the admin.
Instance Method Details
#files ⇒ Object
Convenience method for only finding the assets that are files
22 23 24 |
# File 'lib/transit/model/attachments.rb', line 22 def files self.assets.reject{ |asset| asset.image? } end |
#image? ⇒ Boolean
17 18 19 |
# File 'lib/transit/model/attachments.rb', line 17 def image? image.file? end |
#images ⇒ Object
Convenience method for only finding the assets that are images
13 14 15 |
# File 'lib/transit/model/attachments.rb', line 13 def images self.assets.find_all{ |asset| asset.image? } end |
#preview_image_url ⇒ Object
Override to show a “default image” in the admin.
27 28 29 |
# File 'lib/transit/model/attachments.rb', line 27 def preview_image_url nil end |