Sha256: eadd69d97e8f3a600caa6765eab04753e7c110f72a556c79002b8aad6b9be58e

Contents?: true

Size: 871 Bytes

Versions: 29

Compression:

Stored size: 871 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

    has_and_belongs_to_many :test_objects,
        join_table: "adminpanel_test_object_category"

    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

29 entries across 29 versions & 1 rubygems

Version Path
adminpanel-3.4.7 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.6 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.5 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.4 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.3 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.2 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.1 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.4.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.3.4 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.3.3 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.3.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.2.1 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.2.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.1.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-3.0.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.6.1 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.6.0 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.5.5 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.5.4 test/dummy/app/models/adminpanel/category.rb
adminpanel-2.5.3 test/dummy/app/models/adminpanel/category.rb