Sha256: 83a9da57f30264d8c3a28e9d8d337e9329095981f9ac1748e88615e184f8a759

Contents?: true

Size: 754 Bytes

Versions: 3

Compression:

Stored size: 754 Bytes

Contents

module Enjoy
  module Models
    module Mongoid
      module GalleryImage
        extend ActiveSupport::Concern
        include Enjoy::MongoidPaperclip

        included do

          acts_as_nested_set
          scope :sorted, -> { order_by([:lft, :asc]) }

          enjoy_cms_mongoid_attached_file(:image,
                    styles: lambda { |attachment| attachment.instance.image_styles },
                    convert_options: lambda { |attachment| attachment.instance.image_convert_options },
                    content_type: { content_type: ["image/jpg", "image/jpeg", "image/png"] }
          )
        end

        def image_styles
          {}
        end
        def image_convert_options
          {}
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enjoy_cms-0.3.0.4 lib/enjoy/models/mongoid/gallery_image.rb
enjoy_cms-0.3.0.3 lib/enjoy/models/mongoid/gallery_image.rb
enjoy_cms-0.3.0.2 lib/enjoy/models/mongoid/gallery_image.rb