aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-12-23 08:52:40 +0100
committerYves Senn <yves.senn@gmail.com>2014-12-23 08:52:40 +0100
commitd56b766056837b2db06c568ee78a511fd6c7a84b (patch)
tree992cc567a73c6cd0672706067c6f53689ec5cea1 /activerecord/lib/active_record
parentced687fe710b2f3d6cf0d0e978bdb531357299e4 (diff)
parent2859341c383daac74608f978d8e8fad2229042a3 (diff)
downloadrails-d56b766056837b2db06c568ee78a511fd6c7a84b.tar.gz
rails-d56b766056837b2db06c568ee78a511fd6c7a84b.tar.bz2
rails-d56b766056837b2db06c568ee78a511fd6c7a84b.zip
Merge pull request #18162 from romaimperator/master
Fixing numeric attrs when set to same negative value
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/type/numeric.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/type/numeric.rb b/activerecord/lib/active_record/type/numeric.rb
index fa43266504..674f996f38 100644
--- a/activerecord/lib/active_record/type/numeric.rb
+++ b/activerecord/lib/active_record/type/numeric.rb
@@ -29,7 +29,7 @@ module ActiveRecord
# 'wibble'.to_i will give zero, we want to make sure
# that we aren't marking int zero to string zero as
# changed.
- value.to_s !~ /\A\d+\.?\d*\z/
+ value.to_s !~ /\A-?\d+\.?\d*\z/
end
end
end