aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
diff options
context:
space:
mode:
authorKonstantin Shabanov <etehtsea@gmail.com>2013-08-22 14:56:22 +0700
committerKonstantin Shabanov <etehtsea@gmail.com>2013-08-22 14:56:22 +0700
commita01756c33ed9e2fcb3724dbf607ba64c963b112f (patch)
tree43b357a5e40864d92558f64e7a884430c16fc9bd /activerecord/lib/active_record/connection_adapters/postgresql
parent9208338b0f982e9776f29caeb46795c4cd9207a1 (diff)
downloadrails-a01756c33ed9e2fcb3724dbf607ba64c963b112f.tar.gz
rails-a01756c33ed9e2fcb3724dbf607ba64c963b112f.tar.bz2
rails-a01756c33ed9e2fcb3724dbf607ba64c963b112f.zip
Use infinity const
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql')
-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