user account info completed change

dev_forum
p31729568 6 years ago
parent 9722971899
commit 4fd9279f79

@ -544,15 +544,6 @@ class User < ApplicationRecord
Educoder::Utils.random_hex(16) Educoder::Utils.random_hex(16)
end end
# 基本资料是否完善
def base_info_completed?
user_columns = %i[nickname lastname]
user_extension_columns = %i[gender location location_city identity school_id department]
user_columns.all? { |column| public_send(column).present? } &&
user_extension_columns.all? { |column| user_extension.send(column).present? }
end
# 全部已认证 # 全部已认证
def all_certified? def all_certified?
authentication? && professional_certification? authentication? && professional_certification?

@ -21,5 +21,5 @@ json.school_name extension&.school&.name
json.department_id extension&.department_id json.department_id extension&.department_id
json.department_name extension&.department&.name json.department_name extension&.department&.name
json.base_info_completed user.base_info_completed? json.base_info_completed user.profile_completed?
json.all_certified user.all_certified? json.all_certified user.all_certified?

Loading…
Cancel
Save