Skip to content

Commit

Permalink
Authorize | character in variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Jan 11, 2024
1 parent c450b47 commit fac0f2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
Expand Down

0 comments on commit fac0f2e

Please sign in to comment.