diff options
author | Andriy Tyurnikov <Andriy.Tyurnikov@gmail.com> | 2011-03-10 19:50:55 +0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-03-12 21:12:44 -0200 |
commit | f48d3d4df6c8ff6ab544f5fe384af2a0552984d7 (patch) | |
tree | 148b5ef71ed3d8fbb02ad77b66f90a15848e4f38 /activemodel/lib/active_model | |
parent | 015192560b7e81639430d7e46c410bf6a3cd9223 (diff) | |
download | rails-f48d3d4df6c8ff6ab544f5fe384af2a0552984d7.tar.gz rails-f48d3d4df6c8ff6ab544f5fe384af2a0552984d7.tar.bz2 rails-f48d3d4df6c8ff6ab544f5fe384af2a0552984d7.zip |
length validation for fixnums
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/validations/length.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb index 7af6c83460..3e6f6e62e6 100644 --- a/activemodel/lib/active_model/validations/length.rb +++ b/activemodel/lib/active_model/validations/length.rb @@ -42,7 +42,8 @@ module ActiveModel next unless check_value = options[key] value ||= [] if key == :maximum - + + next if value.kind_of?(Fixnum) && value.to_s.size.send(validity_check, check_value) next if value && value.size.send(validity_check, check_value) errors_options = options.except(*RESERVED_OPTIONS) |