Sha256: 83fc803b11e868ebd7d0209fe1f1277da7f083dd8b39d8b46b47f9cea9be663c

Contents?: true

Size: 675 Bytes

Versions: 44

Compression:

Stored size: 675 Bytes

Contents

module Locomotive
  module Wagon

    class EditableElementDecorator < Locomotive::Steam::Decorators::TemplateDecorator

      include ToHashConcern
      include PersistAssetsConcern

      attr_accessor :__content_assets_pusher__

      def initialize(object, locale = nil, content_assets_pusher)
        self.__content_assets_pusher__ = content_assets_pusher
        super(object, locale, nil)
      end

      def __attributes__
        %i(block slug content)
      end

      def content
        case value = super
        when %r(^/samples/)
          asset_io(value)
        else
          replace_with_content_assets!(value)
        end
      end

    end

  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.0.0.pre.alpha.3 lib/locomotive/wagon/decorators/editable_element_decorator.rb
locomotivecms_wagon-2.0.0.pre.alpha.2 lib/locomotive/wagon/decorators/editable_element_decorator.rb
locomotivecms_wagon-2.0.0.pre.alpha.1 lib/locomotive/wagon/decorators/editable_element_decorator.rb
locomotivecms_wagon-2.0.0.pre.alpha lib/locomotive/wagon/decorators/editable_element_decorator.rb