Bug #367
Regex for "validates_format_of" in Parameter model does not look right
Description
I have a parameter value with the value:
test value
However, I got a validation error because the following validation does not accept a variety of characters.
validates_format_of :name, :value, :with => /\A(\S+\s?)+\Z/, :message => "can't be blank or contain trailing white space"
It would be useful to have a more liberal validation like so:
validates_format_of :name, :value, :with => /^[\w\d\W]+$/, :message => "can't be blank or contain trailing white space"
So that the following lines can be accommodated:
* - nofile 65535%%* - nproc 65535
for /etc/security/limits.conf, for example.
Associated revisions
Fixes #367 - Parameter validates_format_of is too restrictive
History
#1
Updated by Ohad Levy almost 12 years ago
patch? :)
#2
Updated by Ohad Levy almost 12 years ago
- Category set to Database
- Assignee set to Bash Shell
- Target version set to 0.1-6
#3
Updated by Paul Kelly almost 12 years ago
- Status changed from New to Ready For Testing
- Branch set to bug/367-validates_format_of-parameter
Oops! Sorry about this Bash Shell but I did this fix before I noticed that it was assigned to you. :-(
However I think that the re should be /^.*\S$/
#4
Updated by Paul Kelly almost 12 years ago
- % Done changed from 0 to 100
Applied in changeset 1f0c2f2ef54f77a3b559c8d2119168395c51ff44.
#5
Updated by Paul Kelly almost 12 years ago
- Status changed from Ready For Testing to Closed
Fixes #367 - Parameter validates_format_of is too restrictive