Sha256: f51fff260a10c45c92b3394eed90472ab028038e5333b4d771076c617f471f0e

Contents?: true

Size: 992 Bytes

Versions: 4

Compression:

Stored size: 992 Bytes

Contents

class <%= camelcased_class_name %> < Enjoy::Catalog::Item

  has_and_belongs_to_many :item_categories, class_name: "<%= camelcased_class_name %>Category", inverse_of: nil
  alias :<%= underscored_class_name %>_categories :item_categories

  embeds_many :item_images, cascade_callbacks: true, class_name: "<%= camelcased_class_name %>Image"
  alias :<%= underscored_class_name %>_images :item_images

  has_and_belongs_to_many :related_items, :class_name => "<%= camelcased_class_name %>", :inverse_of => :related_items
  alias :related_<%= underscored_pluralized_class_name %> :related_items

  def image_styles
    {}
  end

  def image_jcrop_options
    {}
  end

  
  def routes_namespace
    :main_app # or nil
  end


  ############# rails_admin ##############
  def self.rails_admin_add_fields
    {}
  end

  def self.rails_admin_add_config(config)
  end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enjoy_cms_catalog-0.3.7 lib/generators/enjoy/catalog/models/templates/item.erb
enjoy_cms_catalog-0.3.6 lib/generators/enjoy/catalog/models/templates/item.erb
enjoy_cms_catalog-0.3.5 lib/generators/enjoy/catalog/models/templates/item.erb
enjoy_cms_catalog-0.3.4 lib/generators/enjoy/catalog/models/templates/item.erb