Sha256: 8103729412ef1250bb7bc0192d0d5a0e778d93efebb344a80020a1e09c8ddca2

Contents?: true

Size: 730 Bytes

Versions: 2

Compression:

Stored size: 730 Bytes

Contents

module Adminpanel
  class Category < ActiveRecord::Base
    include Adminpanel::Base
    validates_presence_of :model

    has_many :categorizations
    has_many :products, :through => :categorizations, :dependent => :destroy


    def self.form_attributes
      [
				{"name" => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name"}},
				# {'model' => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name", 'show' => 'false'}},
				{"product_ids" => {"type" => "has_many", "model" => "Adminpanel::Product", "name" => "product_ids"}},
      ]
    end

    def self.display_name
        "Categoria"
    end

    def self.icon
        "icon-truck"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adminpanel-2.0.1 spec/dummy/app/models/adminpanel/category.rb
adminpanel-2.0.0 spec/dummy/app/models/adminpanel/category.rb