Sha256: f4d366a63932fff1fa554e310708dcd868eb969256fd9d7b1e08f8d2bb7684de
Contents?: true
Size: 988 Bytes
Versions: 20
Compression:
Stored size: 988 Bytes
Contents
module Adminpanel class Department < ActiveRecord::Base include Adminpanel::Base belongs_to :category has_many :items has_many :product, :through => :items, :dependent => :destroy def self.form_attributes [ { 'category_id' => { 'type' => 'belongs_to', 'label' => 'category', 'placeholder' => 'category', 'model' => 'Adminpanel::Category', } }, { 'product_ids' => { 'type' => 'has_many', 'label' => 'product', 'placeholder' => 'product', 'model' => 'Adminpanel::Product', } }, { 'name' => { 'type' => 'text_field', 'label' => 'name', 'placeholder' => 'name', } }, ] end def self.display_name 'Departamento' #singular end # def self.icon # "truck" # fa-{icon} # end end end
Version data entries
20 entries across 20 versions & 1 rubygems