From 0e34a7efa6992e6771d34dc8163b79dd7df52667 Mon Sep 17 00:00:00 2001 From: Chris Constantine Date: Thu, 18 Apr 2013 12:24:14 -0700 Subject: Fix loading of fixtures when the column type is a postgres array of strings. - A string in an array of strings that has a quote char (') needs to have that quote char escaped if the array is getting wrapped in quote chars. --- .../lib/active_record/connection_adapters/postgresql/quoting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb index 6329733abc..40a3b82839 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb @@ -32,7 +32,7 @@ module ActiveRecord when 'point' then super(PostgreSQLColumn.point_to_string(value)) else if column.array - "'#{PostgreSQLColumn.array_to_string(value, column, self)}'" + "'#{PostgreSQLColumn.array_to_string(value, column, self).gsub(/'/, "''")}'" else super end -- cgit v1.2.3