fix account update

dev_course
p31729568 6 years ago
parent 595e4bcf64
commit a5c784c423

@ -10,9 +10,9 @@ class Users::UpdateAccountForm
validates :gender, presence: true, numericality: { only_integer: true }, inclusion: { in: [0, 1] }
validates :location, presence: true
validates :location_city, presence: true
validates :identity, presence: true, numericality: { only_integer: true }, inclusion: { in: [0, 1, 2] }
validates :technical_title, presence: true, unless: -> { identity == 1 }
validates :student_id, presence: true, if: -> { identity == 1 }
validates :identity, presence: true, inclusion: { in: %w[teacher student professional ] }
validates :technical_title, presence: true, unless: -> { identity.to_s == 'student' }
validates :student_id, presence: true, if: -> { identity.to_s == 'student' }
validates :school_id, presence: true
validate :check_school_exist

Loading…
Cancel
Save