Module: Slices::HasAttachments::PageInstanceMethods
- Included in:
- Page
- Defined in:
- lib/slices/has_attachments.rb
Instance Method Summary collapse
- #attachment_assets ⇒ Object
- #slice_attachment_asset_ids ⇒ Object (also: #attachment_asset_ids)
Instance Method Details
#attachment_assets ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/slices/has_attachments.rb', line 48 def .inject([]) do |memo, asset_id| begin memo << ::Asset.find(asset_id) rescue Mongoid::Errors::DocumentNotFound end memo end end |
#slice_attachment_asset_ids ⇒ Object Also known as: attachment_asset_ids
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/slices/has_attachments.rb', line 58 def [].tap do |asset_ids| self.class..each do || slices_for().each do |slice| if slice.respond_to? : asset_ids.concat slice. end end end end end |