Sha256: 6b09457974e2b5740c2a253c1116f622e050f05f68889aa583106092e895b389

Contents?: true

Size: 774 Bytes

Versions: 10

Compression:

Stored size: 774 Bytes

Contents

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

    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

10 entries across 10 versions & 1 rubygems

Version Path
adminpanel-2.2.5 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.2.4 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.2.3 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.2.2 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.2.1 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.2.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.1.7 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.1.6 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.1.5 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.1.3 test/dummy/app/models/adminpanel/category.rb