Sha256: 8beb52275104cac86a46d4785ddebb798121571706658056c328930bfbe1ccdc

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 Bytes

Contents

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

        included do
          if defined?(RailsAdminComments)
            include RailsAdminComments::Commentable
          end


          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

2 entries across 2 versions & 1 rubygems

Version Path
enjoy_cms-0.3.1.1 lib/enjoy/models/mongoid/gallery_image.rb
enjoy_cms-0.3.1 lib/enjoy/models/mongoid/gallery_image.rb