# encoding:utf-8
class PosterQrcodeScanRecord < ActiveRecord::Base
  has_paper_trail
  self.table_name = "poster_qrcode_scan_records"
  validates_presence_of :poster_qrcode_id, :wx_uid, :scan_times

  belongs_to :wx_user, :foreign_key => :wx_uid
  belongs_to :poster_qrcode_record, :foreign_key => :poster_qrcode_id

  rails_admin do
    navigation_label '用户管理'
    weight -500
    parent PosterQrcodeRecord

    list do
      filters [:id, :wx_user, :poster_qrcode_record]
      field :id
      field :poster_qrcode_id
      field :poster_qrcode_record
      field :wx_uid
      field :wx_user
      field :ip
      field :scan_times
      field :scan_last_time
      field :created_at
      field :updated_at
    end

    show do
      field :id
      field :poster_qrcode_id
      field :poster_qrcode_record
      field :wx_uid
      field :wx_user
      field :ip
      field :scan_times
      field :scan_last_time
      field :created_at
      field :updated_at
    end

    edit do
      field :poster_qrcode_id
      field :wx_uid
      field :ip
      field :scan_times
      field :scan_last_time
    end
  end
end