diff --git a/app/models/concerns/acts_as_profile_field.rb b/app/models/concerns/acts_as_profile_field.rb index 74c5c1e98..8686fa42b 100644 --- a/app/models/concerns/acts_as_profile_field.rb +++ b/app/models/concerns/acts_as_profile_field.rb @@ -1,10 +1,12 @@ # Used for sharing behavior between ProfileField and CustomProfileField -concern :ActsAsProfileField do +module ActsAsProfileField + extend ActiveSupport::Concern + + WORD_REGEX = /\w+/.freeze + included do before_create :generate_attribute_name - WORD_REGEX = /\w+/.freeze # rubocop:disable Lint/ConstantDefinitionInBlock - validates :label, presence: true, uniqueness: { case_sensitive: false } validates :attribute_name, presence: true, on: :update end