aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2013-02-26 16:57:18 -0800
committerSteve Klabnik <steve@steveklabnik.com>2013-02-26 16:57:18 -0800
commitee291b9b41a959e557b7732100d1ec3f27aae4f8 (patch)
tree8aba4827751fd39fd1cb8fcbd270cd0578f1713f /activerecord/lib/active_record/connection_adapters/abstract
parent55a1765942bc3d78ba5d449b5daf17a3c902e57c (diff)
downloadrails-ee291b9b41a959e557b7732100d1ec3f27aae4f8.tar.gz
rails-ee291b9b41a959e557b7732100d1ec3f27aae4f8.tar.bz2
rails-ee291b9b41a959e557b7732100d1ec3f27aae4f8.zip
Revert "Merge pull request #9208 from dylanahsmith/3-2-mysql-quote-numeric"
This reverts commit 921a296a3390192a71abeec6d9a035cc6d1865c8.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/quoting.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
index fe0b1959f6..f93c7cd74a 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -25,19 +25,13 @@ module ActiveRecord
when true, false
if column && column.type == :integer
value ? '1' : '0'
- elsif column && [:text, :string, :binary].include?(column.type)
- value ? "'1'" : "'0'"
else
value ? quoted_true : quoted_false
end
# BigDecimals need to be put in a non-normalized form and quoted.
when nil then "NULL"
- when Numeric, ActiveSupport::Duration
- value = BigDecimal === value ? value.to_s('F') : value.to_s
- if column && ![:integer, :float, :decimal].include?(column.type)
- value = "'#{value}'"
- end
- value
+ when BigDecimal then value.to_s('F')
+ when Numeric then value.to_s
when Date, Time then "'#{quoted_date(value)}'"
when Symbol then "'#{quote_string(value.to_s)}'"
else