diff --git a/app/models/variable.rb b/app/models/variable.rb index 1514e6a6..c956072e 100644 --- a/app/models/variable.rb +++ b/app/models/variable.rb @@ -39,7 +39,7 @@ class Variable < ApplicationRecord accepts_nested_attributes_for :distributions, reject_if: proc { |attr| attr["kind"].nil? }, allow_destroy: true - validates :name, format: { with: /\A[a-zA-Z][-.=:_a-zA-Z0-9]*\z/, message: "%{value} is not a valid variable name." } + validates :name, format: { with: /\A[a-zA-Z][-.=:_|a-zA-Z0-9]*\z/, message: "%{value} is not a valid variable name." } validates :name, :io_mode, :type, :shape, presence: true, allow_blank: false validates :name, uniqueness: { scope: [:discipline], message: -> (object, data) { "%{value} as a variable name should be unique for discipline #{object.discipline.name}."