aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-08-16 06:26:30 +0000
committerMichael Koziarski <michael@koziarski.com>2007-08-16 06:26:30 +0000
commit29b0707f07f148d98515125dab44b73cfdc0a3d4 (patch)
tree9566ad90027d1164feb52ab57e5ec109eb1d0c02 /activerecord/lib/active_record/connection_adapters/abstract
parentf008566d656fb3b86c6421520ffcd05828a2108f (diff)
downloadrails-29b0707f07f148d98515125dab44b73cfdc0a3d4.tar.gz
rails-29b0707f07f148d98515125dab44b73cfdc0a3d4.tar.bz2
rails-29b0707f07f148d98515125dab44b73cfdc0a3d4.zip
Improve performance and functionality of the postgresql adapter. Closes #8049 [roderickvd]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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, 7 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
index aa405eb47c..b3b3d70359 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -11,12 +11,12 @@ module ActiveRecord
when String, ActiveSupport::Multibyte::Chars
value = value.to_s
if column && column.type == :binary && column.class.respond_to?(:string_to_binary)
- "'#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode)
+ "#{quoted_string_prefix}'#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode)
elsif column && [:integer, :float].include?(column.type)
value = column.type == :integer ? value.to_i : value.to_f
value.to_s
else
- "'#{quote_string(value)}'" # ' (for ruby-mode)
+ "#{quoted_string_prefix}'#{quote_string(value)}'" # ' (for ruby-mode)
end
when NilClass then "NULL"
when TrueClass then (column && column.type == :integer ? '1' : quoted_true)
@@ -28,7 +28,7 @@ module ActiveRecord
if value.acts_like?(:date) || value.acts_like?(:time)
"'#{quoted_date(value)}'"
else
- "'#{quote_string(value.to_yaml)}'"
+ "#{quoted_string_prefix}'#{quote_string(value.to_yaml)}'"
end
end
end
@@ -56,6 +56,10 @@ module ActiveRecord
def quoted_date(value)
value.to_s(:db)
end
+
+ def quoted_string_prefix
+ ''
+ end
end
end
end