diff options
author | Xavier Noria <fxn@hashref.com> | 2014-10-02 23:03:29 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2014-10-02 23:03:29 +0200 |
commit | 29006a7795eb842ab0a07f936f1ecc858319664b (patch) | |
tree | 38c69270f30acdda5a3e88869e4c6667c0143e96 /activemodel | |
parent | 4cd57a88b49e900f77514b3a8067854eb45e21a9 (diff) | |
parent | 4e511001b445c67e6d06d4e183f9cef148449e62 (diff) | |
download | rails-29006a7795eb842ab0a07f936f1ecc858319664b.tar.gz rails-29006a7795eb842ab0a07f936f1ecc858319664b.tar.bz2 rails-29006a7795eb842ab0a07f936f1ecc858319664b.zip |
Merge pull request #17148 from mgenereu/patch-1
Disallow appended newlines when parsing as integer
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index 5bd162433d..13d6a966c0 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -67,7 +67,7 @@ module ActiveModel end def parse_raw_value_as_an_integer(raw_value) - raw_value.to_i if raw_value.to_s =~ /\A[+-]?\d+\Z/ + raw_value.to_i if raw_value.to_s =~ /\A[+-]?\d+\z/ end def filtered_options(value) |