Sha256: 7349d131078df45042df7a013384452f4c0004512b36ad9341251112e6945004

Contents?: true

Size: 725 Bytes

Versions: 14

Compression:

Stored size: 725 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 },
                    content_type: { content_type: ["image/jpg", "image/jpeg", "image/png"] }
          )
        end

        def image_styles
          {}
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
enjoy_cms-0.3.7.4 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.7.3 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.7.2 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.7.1 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.7 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.6.2 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.6.1 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.6 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.5 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.4 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.3 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.2.1 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.2 lib/enjoy/models/mongoid/gallery.rb
enjoy_cms-0.3.1.2 lib/enjoy/models/mongoid/gallery.rb