Sha256: 28099bd2c99668312156678df55dea737f5c9164040cc93c65391a31f737d559

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

module Enjoy::Catalog
  module Models
    module Item
      extend ActiveSupport::Concern
      include Enjoy::Model
      include Enjoy::Enableable
      include Enjoy::Seoable
      include Enjoy::SitemapDataField

      include Enjoy::Catalog.orm_specific('Item')

      include ManualSlug

      included do
        manual_slug :name

        rails_admin(&Enjoy::Catalog::Admin::Item.config(rails_admin_add_fields) { |config|
          rails_admin_add_config(config)
        })
      end

      def clean_excerpt
        Rails::Html::FullSanitizer.new.sanitize(self.excerpt.strip)
      end

      def clean_content
        Rails::Html::FullSanitizer.new.sanitize(self.content.strip)
      end

      # module ClassMethods
      #   def rails_admin_add_fields
      #     {}
      #   end
      #
      #   def rails_admin_add_config(config)
      #   end
      # end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enjoy_cms_catalog-0.2.0 lib/enjoy/catalog/models/item.rb