# encoding: utf-8
class CentAward < ActiveRecord::Base
  self.table_name = "cent_awards"
  validates :c_type,:count,presence: true

  TYPE_ENUM = [
                 ["第一天", "one_day"],
                 ["第二天", "two_day"],
                 ["第三天", "three_day"],
                 ["第四天", "four_day"],
                 ["第五天", "five_day"],
                 ["第六天", "six_day"],
                 ["第七天", "seven_day"],
                 ["首次登录", "first_login"],
                 ["新人注册", "new_man"],
  ]
  rails_admin do
    navigation_label '积分奖励配置'
    parent CentBalance
    weight -500
    list do
      filters [:c_type,:count]
      field :id
      field :c_type, :enum do
        enum do
          TYPE_ENUM
        end
      end
      field :count
      field :created_at
      # field :updated_at
    end
    show do
      field :id
      field :c_type, :enum do
        enum do
          TYPE_ENUM
        end
      end
      field :count
      field :created_at
      field :updated_at
    end
    edit do
      field :c_type, :enum do
        enum do
          TYPE_ENUM
        end
      end
      field :count
    end

  end

end
