32 lines
1.2 KiB
Ruby
32 lines
1.2 KiB
Ruby
class OlympiaStudentDataFields
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
include OrbitModel::Status
|
|
include OrbitModel::Impression
|
|
# encoding: utf-8
|
|
include OrbitTag::Taggable
|
|
include OrbitCategory::Categorizable
|
|
field :StudentIdentity , type: String , default: ''
|
|
field :StudentName , type: String , default: ''
|
|
field :StudentSex , type: String , default: ''
|
|
field :StudentIDNO , type: String , default: ''
|
|
field :StudentBirthYear , type: Fixnum , default: Time.now.year
|
|
field :StudentBirthMonth , type: Fixnum , default: Time.now.month
|
|
field :StudentBirthDay , type: Fixnum , default: Time.now.day
|
|
field :StudentClass , type: String , default: ''
|
|
field :StudentPhone , type: String , default: ''
|
|
field :StudentCode , type: String , default: ''
|
|
field :StudentAddress , type: String , default: ''
|
|
field :StudentArea , type: String , default: ''
|
|
mount_uploader :StudentFile, OlympiaImagesUploader
|
|
field :approved , type: Boolean , default: true
|
|
field :olympia_school_data_fields_id , type: String , default: ''
|
|
after_initialize do
|
|
if !self.new_record?
|
|
if self.approved.nil?
|
|
self.approved = true
|
|
self.save!
|
|
end
|
|
end
|
|
end
|
|
end |