Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
[dm-validations] :format validator now works with fixnums
Browse files Browse the repository at this point in the history
* Always calling #to_s on the value to validate leads to
  4 spec errors, therefore why I added the check if value
  is_a?(Fixnum)

[#859 state:resolved]
  • Loading branch information
snusnu committed Jul 10, 2009
1 parent e4a86fe commit 79ebeb3
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -34,7 +34,7 @@ def call(target)

valid = case validator
when Proc then validator.call(value)
when Regexp then value =~ validator
when Regexp then (value.is_a?(Fixnum) ? value.to_s : value) =~ validator
else
raise UnknownValidationFormat, "Can't determine how to validate #{target.class}##{field_name} with #{validator.inspect}"
end
Expand Down

0 comments on commit 79ebeb3

Please sign in to comment.