Sha256: d0f5c111ca482fd00440bd923f467e2c85e39716a7e329bc47bb0fcc8ae2ab0d

Contents?: true

Size: 888 Bytes

Versions: 2

Compression:

Stored size: 888 Bytes

Contents

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

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


          manual_slug :name

          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.rb
enjoy_cms-0.3.1 lib/enjoy/models/mongoid/gallery.rb