aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-25 13:57:06 -0700
committerSean Griffin <sean@thoughtbot.com>2014-11-25 13:58:26 -0700
commitd74e716b48b19a608a0445996cfcf17d304f289f (patch)
tree723ac2093ed710242985cea8761176989867ccdc /activerecord/lib/active_record
parent4426b726bfd3f7d26224c2d8ffdc3c00cd1b561a (diff)
downloadrails-d74e716b48b19a608a0445996cfcf17d304f289f.tar.gz
rails-d74e716b48b19a608a0445996cfcf17d304f289f.tar.bz2
rails-d74e716b48b19a608a0445996cfcf17d304f289f.zip
Move PG float quoting to the correct location
Not sure how we missed this case when we moved everything else to the `_quote` method.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb22
1 files changed, 6 insertions, 16 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
index f95f45c689..991c41327f 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
@@ -14,22 +14,6 @@ module ActiveRecord
@connection.unescape_bytea(value) if value
end
- # Quotes PostgreSQL-specific data types for SQL input.
- def quote(value, column = nil) #:nodoc:
- return super unless column
-
- case value
- when Float
- if value.infinite? || value.nan?
- "'#{value}'"
- else
- super
- end
- else
- super
- end
- end
-
# Quotes strings for use in SQL input.
def quote_string(s) #:nodoc:
@connection.escape(s)
@@ -94,6 +78,12 @@ module ActiveRecord
elsif value.hex?
"X'#{value}'"
end
+ when Float
+ if value.infinite? || value.nan?
+ "'#{value}'"
+ else
+ super
+ end
else
super
end