Reject non numeric values for numeric fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6228 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+5
-1
@@ -278,7 +278,11 @@ class Query < ActiveRecord::Base
|
||||
# allowed_values = values & ([""] + (filter_options[:values] || []).collect {|val| val[1]})
|
||||
# filters[field] = {:operator => operator, :values => allowed_values } if (allowed_values.first and !allowed_values.first.empty?) or ["o", "c", "!*", "*", "t"].include? operator
|
||||
#end
|
||||
filters[field] = {:operator => operator, :values => (values || ['']) }
|
||||
values ||= ['']
|
||||
if filter_options[:type] == :integer
|
||||
values = values.select {|v| v.blank? || v.match(/^\d+(\.\d+)?$/) }
|
||||
end
|
||||
filters[field] = {:operator => operator, :values => values }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user