Sha256: 2f875435f35d9333fa334d8bf3661672237dad0f87654e999b7398cd1bd80192

Contents?: true

Size: 654 Bytes

Versions: 6

Compression:

Stored size: 654 Bytes

Contents

module Adminpanel
    class Category < ActiveRecord::Base
        attr_accessible :product_ids, :name

        has_many :categorizations
		has_many :products, :through => :categorizations, :dependent => :destroy
		
        
        def self.form_attributes
            [
				{"product_ids" => {"type" => "has_many", "model" => "Adminpanel::Product", "name" => "product_ids"}},
				{"name" => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name"}},
            ]
        end

        def self.display_name
            "Category"
        end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adminpanel-1.2.4 spec/dummy/app/models/adminpanel/category.rb
adminpanel-1.2.3 spec/dummy/app/models/adminpanel/category.rb
adminpanel-1.2.2 spec/dummy/app/models/adminpanel/category.rb
adminpanel-1.2.1 spec/dummy/app/models/adminpanel/category.rb
adminpanel-1.2.0 spec/dummy/app/models/adminpanel/category.rb
adminpanel-1.1.0 spec/dummy/app/models/adminpanel/category.rb