class ProductSaleType < ActiveRecord::Base
    has_paper_trail
    self.table_name = 'product_sale_types'
    has_many :products, :foreign_key => :sale_zone
    validates :name,presence:true
    
    rails_admin do
        navigation_label '商品管理'
        parent Product
        weight -240
        nestable_tree({
            position_field: :position,
            max_depth: 2
        })

        list do 
            filters [:name]
            field :id
            field :name
            field :products
        end

        show do
            field :id
            field :name
            field :products
        end

        edit do 
            field :name 
            field :products
        end 

    end

end