Merge pull request #17148 from mgenereu/patch-1

Disallow appended newlines when parsing as integer
This commit is contained in:
Xavier Noria 2014-10-02 23:03:29 +02:00
commit 29006a7795
1 changed files with 1 additions and 1 deletions

View File

@ -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)