From fac0f2e432d86353937fbc8784a8f52271d91a15 Mon Sep 17 00:00:00 2001 From: relf Date: Thu, 11 Jan 2024 10:06:28 +0100 Subject: [PATCH] Authorize | character in variable names --- app/models/variable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}."