Sha256: e2a00b6a80f37741012294bab33a8f1146b7cc302a60964f3bd9fa65e1856386

Contents?: true

Size: 820 Bytes

Versions: 3

Compression:

Stored size: 820 Bytes

Contents

module Enjoy::Gallery
  module Admin
    module EmbeddedImage
      def self.config(fields = {})

        if fields
          if fields.is_a?(Hash)
            fields.reverse_merge!({image: :enjoy_image})
          else
            finded = false
            fields.each { |g|
              finded = !!g[:fields][:image] unless finded
            }
            unless finded
              fields << {
                name: :image,
                fields: {
                  image: :enjoy_image
                }
              }
            end
          end
        end

        if block_given?
          Enjoy::Admin::EmbeddedElement.config(nil, fields) do |config|
            yield config
          end
        else
          Enjoy::Admin::EmbeddedElement.config(nil, fields)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enjoy_cms_gallery-0.4.1 lib/enjoy/gallery/admin/embedded_image.rb
enjoy_cms_gallery-0.4.0.2 lib/enjoy/gallery/admin/embedded_image.rb
enjoy_cms_gallery-0.4.0.1 lib/enjoy/gallery/admin/embedded_image.rb