Module: Iron::Entry::Exportable
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActionView::Helpers::TagHelper
- Included in:
- Iron::Entry
- Defined in:
- app/models/iron/entry/exportable.rb
Instance Method Summary collapse
- #export_attachment_path(blob) ⇒ Object
- #export_attachments ⇒ Object
- #export_attributes ⇒ Object
- #export_json ⇒ Object
Instance Method Details
#export_attachment_path(blob) ⇒ Object
29 30 31 |
# File 'app/models/iron/entry/exportable.rb', line 29 def (blob) "#{id}/#{blob.key}_#{blob.filename}" end |
#export_attachments ⇒ Object
23 24 25 26 27 |
# File 'app/models/iron/entry/exportable.rb', line 23 def .map do |blob| { path: (blob), blob: blob } end end |
#export_attributes ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/iron/entry/exportable.rb', line 10 def export_attributes { gid: to_gid.to_s, id: id, content_type_handle: content_type.handle, created_at: created_at.iso8601, updated_at: updated_at.iso8601, route: route, creator_gid: creator&.to_gid&.to_s, fields: export_fields_by_locale } end |
#export_json ⇒ Object
6 7 8 |
# File 'app/models/iron/entry/exportable.rb', line 6 def export_json JSON.pretty_generate(export_attributes) end |