jruby/activerecord-jdbc-adapter — pull request #415 by alno (2013-07-01 14:27:21+00:00)
Title: Fix array quote escaping

Porting correct escaping of single quotes in arrays from AR (see https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb#L36)

Failure of modified test before patch:

Error: test_strings_with_quotes(PostgreSQLArrayTypeTest)
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: org.postgresql.util.PSQLException: ERROR: syntax error at or near "s"
Position: 99: INSERT INTO "pg_arrays" ("tags") VALUES ('{"this has","some \"s that need to be escaped\"","some 's that need to be escaped too"}') RETURNING "id"