Sha256: b249f24b6f623a4a85fa9626a17082fd76a63f0d280c90a3409858c2eec8020a

Contents?: true

Size: 753 Bytes

Versions: 4

Compression:

Stored size: 753 Bytes

Contents

module Adminpanel
  class Item < ActiveRecord::Base
    include Adminpanel::Base

    belongs_to :product
    belongs_to :category

    def self.form_attributes
      [
        {
          'product_id' => {
            'type' => 'belongs_to',
            'label' => 'product',
            'placeholder' => 'product',
            'model' => 'Adminpanel::Product',
          }
        },
        {
          'category_id' => {
            'type' => 'belongs_to',
            'label' => 'category',
            'placeholder' => 'category',
            'model' => 'Adminpanel::Category',
          }
        },

      ]
    end

    def self.display_name
      'Item' #singular
    end

    # def self.icon
    #     "truck" # fa-{icon}
    # end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adminpanel-2.1.7 test/dummy/app/models/adminpanel/item.rb
adminpanel-2.1.6 test/dummy/app/models/adminpanel/item.rb
adminpanel-2.1.5 test/dummy/app/models/adminpanel/item.rb
adminpanel-2.1.3 test/dummy/app/models/adminpanel/item.rb