From dd27c4e5fb338e2571e691c23b39cdd857eca7cd Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 22 Nov 2007 01:29:19 +0000 Subject: PostgreSQL: correct binary escaping. References #8049, closes #10176 [jbasdf, tmacedo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/postgresql_adapter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 64f314a7f6..b5b636d1a4 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -75,7 +75,7 @@ module ActiveRecord if PGconn.respond_to?(:unescape_bytea) self.class.module_eval do define_method(:binary_to_string) do |value| - if value =~ /\\\\\d{3}/ + if value =~ /\\\d{3}/ PGconn.unescape_bytea(value) else value @@ -85,7 +85,7 @@ module ActiveRecord else self.class.module_eval do define_method(:binary_to_string) do |value| - if value =~ /\\\\\d{3}/ + if value =~ /\\\d{3}/ result = '' i, max = 0, value.size while i < max -- cgit v1.2.3