diff --git a/app/models/pool.rb b/app/models/pool.rb index c4b0d6402..8f93bc3cd 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -325,6 +325,14 @@ class Pool < ApplicationRecord errors[:name] << "cannot contain commas" when /\*/ errors[:name] << "cannot contain asterisks" + when /\A_/ + errors[:name] << "cannot begin with an underscore" + when /_\z/ + errors[:name] << "cannot end with an underscore" + when /__/ + errors[:name] << "cannot contain consecutive underscores" + when /[^[:graph:]]/ + errors[:name] << "cannot contain non-printable characters" when "" errors[:name] << "cannot be blank" when /\A[0-9]+\z/