Module: MobileWorkflow::Attachable
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationRecord
- Defined in:
- app/models/concerns/mobile_workflow/attachable.rb
Instance Method Summary collapse
- #attachment_url(attachment) ⇒ Object
- #preview_url(attachment, options: { resize_to_fill: [200, 200] }) ⇒ Object
Instance Method Details
#attachment_url(attachment) ⇒ Object
18 19 20 21 22 |
# File 'app/models/concerns/mobile_workflow/attachable.rb', line 18 def () return nil unless .attached? rails_blob_url(, host: ) end |
#preview_url(attachment, options: { resize_to_fill: [200, 200] }) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/models/concerns/mobile_workflow/attachable.rb', line 8 def preview_url(, options: { resize_to_fill: [200, 200] }) return nil unless .attached? if .image? rails_representation_url(.variant(), host: ) elsif .previewable? rails_representation_url(.preview(), host: ) end end |