Sha256: c54484d79aaac11e7f9bb97c7567ad9001718adb96b70c4bb0d3069c149ffd96

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

module AckRocketCmsCatalog
  module Models
    module Mongoid
      module ItemCategory
        extend ActiveSupport::Concern
        included do
          field :name, type: String, localize: RocketCMS.configuration.localize, default: ""

          include RocketCMSMongoidPaperclip
          rocket_cms_mongoid_attached_file(:image,
                    styles: AckRocketCmsCatalog.configuration.item_category_image_styles,
                    content_type: { content_type: ["image/jpg", "image/jpeg", "image/png"] }
          )

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

          field :excerpt,   type: String, localize: RocketCMS.configuration.localize, default: ""
          field :content,   type: String, localize: RocketCMS.configuration.localize, default: ""

          embeds_many :item_categoty_images, cascade_callbacks: true, class_name: "AckRocketCmsCatalog::ItemCategoryImage"
          alias :images :item_categoty_images
          accepts_nested_attributes_for :item_categoty_images, allow_destroy: true
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ack_rocket_cms_catalog-0.2.0 lib/ack_rocket_cms_catalog/models/mongoid/item_category.rb