aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-08-22 06:45:07 -0700
committerYves Senn <yves.senn@gmail.com>2013-08-22 06:45:07 -0700
commit998d9c89e42d41f99b1970ce229cc4b818db3680 (patch)
tree85906117789295c2518a3295cc512f1e710c44bd /activerecord/lib/active_record
parent042c86d2bf6428f2ebc33b2ca42a29786dfca0fb (diff)
parenta01756c33ed9e2fcb3724dbf607ba64c963b112f (diff)
downloadrails-998d9c89e42d41f99b1970ce229cc4b818db3680.tar.gz
rails-998d9c89e42d41f99b1970ce229cc4b818db3680.tar.bz2
rails-998d9c89e42d41f99b1970ce229cc4b818db3680.zip
Merge pull request #11976 from etehtsea/inf
[PG adapter] Use infinity const
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/cast.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
index ef7b976d4f..ea44e818e5 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
@@ -17,8 +17,8 @@ module ActiveRecord
return string unless String === string
case string
- when 'infinity'; 1.0 / 0.0
- when '-infinity'; -1.0 / 0.0
+ when 'infinity'; Float::INFINITY
+ when '-infinity'; -Float::INFINITY
when / BC$/
super("-" + string.sub(/ BC$/, ""))
else