Correctly set constant in including modules (#11331)
This commit is contained in:
parent
dfc3d96286
commit
5664cd3ca8
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue