# encoding: utf-8
class AppVersion < ActiveRecord::Base
  has_paper_trail
  self.table_name = "app_versions"
  validates :app_type,:app_version,:version_code,presence: true

  VERSION_ENUM= [["安卓","Android"], ["IOS","Ios"]]

  rails_admin do
    navigation_label '版本发布管理'
    weight -500
    list do
      filters [:app_type,:app_version,:version_code]
      field :id
      field :app_type, :enum do
          filterable true
          enum do
              VERSION_ENUM
          end
      end
      field :app_version
      field :version_code
      field :is_force
      field :apk_url
      field :upgrade_point
      field :status
      field :created_at
      # field :updated_at

    end
    show do
      field :id
      field :app_type, :enum do
       filterable true
       enum do
           VERSION_ENUM
       end
      end
      field :app_version
      field :version_code
      field :is_force
      field :apk_url
      field :upgrade_point
      field :status
      field :created_at
      # field :updated_at
    end
    edit do
       field :app_type, :enum do
         filterable true
         enum do
             VERSION_ENUM
         end
       end
       field :app_version
       field :version_code
       field :is_force
       field :apk_url
       field :upgrade_point
       field :status
    end
  end

end
