Sha256: 9b8fbb84911c91c288804b88a1bc62d7ffc1c2db17672f079c6afc5614012774

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

require 'ostruct'

Refinery::Page.class_eval do
  attr_accessor :images_with_captions

  def images_with_captions
    @images_with_captions = image_pages.map do |ref|
      OpenStruct.new(
        {
          image: Refinery::Image.find(ref.image_id),
          caption: ref.caption || ''
        }
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
refinerycms-page-images-3.0.0 app/decorators/models/refinery/page_images_page_decorator.rb