pools: disallow asterisks and numeric-only names.

This commit is contained in:
evazion
2017-08-10 18:37:22 -05:00
parent 3b9a54f681
commit 3b3abac8f6
3 changed files with 7 additions and 1 deletions

View File

@@ -387,8 +387,12 @@ class Pool < ApplicationRecord
errors[:name] << "cannot be any of the following names: any, none, series, collection"
when /,/
errors[:name] << "cannot contain commas"
when /\*/
errors[:name] << "cannot contain asterisks"
when ""
errors[:name] << "cannot be blank"
when /\A[0-9]+\z/
errors[:name] << "cannot contain only digits"
end
end