Don't attempt to call summary on profile during onboarding (#11836)

This commit is contained in:
Jacob Herrington 2020-12-10 07:55:46 -06:00 committed by GitHub
parent e28b75b19a
commit f2722f8701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,9 @@ class ProfileValidator < ActiveModel::Validator
private
def summary_too_long?(record)
# During onboarding, the attribute is not yet available
return unless record.respond_to?(SUMMARY_ATTRIBUTE)
return unless ProfileField.exists?(attribute_name: SUMMARY_ATTRIBUTE)
return if record.summary.blank?