class <%= camelcased_class_name %> < Hancock::Catalog::Item has_and_belongs_to_many :categories, class_name: "<%= camelcased_class_name %>Category", inverse_of: nil alias :<%= underscored_class_name %>_categories :categories embeds_many :item_images, cascade_callbacks: true, class_name: "<%= camelcased_class_name %>Image" alias :<%= underscored_class_name %>_images :item_images accepts_nested_attributes_for :item_images, allow_destroy: true has_and_belongs_to_many :related_items, :class_name => "<%= camelcased_class_name %>", :inverse_of => :related_items alias :related_<%= underscored_pluralized_class_name %> :related_items # # after_save :image_auto_rails_admin_jcrop # def image_auto_rails_admin_jcrop # auto_rails_admin_jcrop(:image) # or nil for cancel autocrop # end # # hancock_cms_attached_file(:image) # def image_styles # super # end # def image_jcrop_options # super # end ############# rails_admin ############## def self.rails_admin_add_fields [] #super end def self.rails_admin_add_config(config) #super(config) end def self.admin_can_user_defined_actions [].freeze end def self.admin_cannot_user_defined_actions [].freeze end def self.manager_can_user_defined_actions [].freeze end def self.manager_cannot_user_defined_actions [].freeze end def self.rails_admin_user_defined_visible_actions [].freeze end rails_admin(&Hancock::Catalog::Admin::Item.config(rails_admin_add_fields) { |config| rails_admin_add_config(config) }) end