class ProductCommend < ActiveRecord::Base
    has_paper_trail
    self.table_name = 'product_commends'
    #has_product_id
    validates :detail,presence:true
    belongs_to :product, :foreign_key => :product_id
    belongs_to :wx_user, :foreign_key => :wx_user_id

    rails_admin do
        navigation_label '商品管理'
        weight -100

        list do 
            filters [:score]
            field :id
            field :detail
            field :score
            field :product
            field :is_enable
            field :wx_user_id
            field :wx_user
            field :is_top
            field :recommend
        end

        show do
            field :id
            field :detail
            field :score
            field :product
            field :is_enable
            field :wx_user_id
            field :wx_user
            field :is_top
            field :recommend
        end

        edit do 
            field :detail
            field :score
            field :product
            field :is_enable
            field :wx_user_id
            field :wx_user
            field :is_top
            field :recommend
        end 

    end

end