renamed validation 'numbers' to 'integers' and added validation code

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1844 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
p.tessenow 14 years ago
parent 6bcc476bcb
commit d1f0ff79ad
  1. 14
      app/models/cost_query/validation/integers.rb
  2. 7
      app/models/cost_query/validation/numbers.rb

@ -0,0 +1,14 @@
module CostQuery::Validation
module Integers
def validate_integers(values = [])
values_passed = true
values.all? do |val|
if val.to_i.to_s != val.to_s
values_passed = false
errors << "\'#{val}\' is not a valid date!"
end
end
values_passed
end
end
end

@ -1,7 +0,0 @@
module CostQuery::Validation
module Numbers
def validate_numbers(values = [])
raise NotImplementedError, "Haven't done number validation just yet!"
end
end
end
Loading…
Cancel
Save