OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/report/validation/integers.rb

17 lines
373 B

module Report::Validation
module Integers
def validate_integers(*values)
values = values.flatten
return true if values.empty?
values.flatten.all? do |val|
if val.to_i.to_s != val.to_s
errors[:int] << val
validate_integers(values - [val])
false
else
true
end
end
end
end
end