diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-08-22 06:45:07 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-08-22 06:45:07 -0700 |
commit | 998d9c89e42d41f99b1970ce229cc4b818db3680 (patch) | |
tree | 85906117789295c2518a3295cc512f1e710c44bd /activerecord | |
parent | 042c86d2bf6428f2ebc33b2ca42a29786dfca0fb (diff) | |
parent | a01756c33ed9e2fcb3724dbf607ba64c963b112f (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/cast.rb | 4 |
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 |