diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-02-18 16:00:47 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-02-18 16:00:47 -0300 |
commit | 1879c259b870938c42d5d52f63123bfa0b8c81c8 (patch) | |
tree | fb11dc4b5ca6bb20092631afa02c9cb392ddb80c /activerecord/lib/active_record/connection_adapters | |
parent | 4f23760a07186ff9c0c5935c971d2978f9f57277 (diff) | |
parent | 8b20c72dd80e2faf531f308d430a145a253aeac3 (diff) | |
download | rails-1879c259b870938c42d5d52f63123bfa0b8c81c8.tar.gz rails-1879c259b870938c42d5d52f63123bfa0b8c81c8.tar.bz2 rails-1879c259b870938c42d5d52f63123bfa0b8c81c8.zip |
Merge branch '4-1-0-beta2'
Conflicts:
actionview/CHANGELOG.md
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/cast.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb index 3a3b500b1f..551a9289c3 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb @@ -142,12 +142,16 @@ module ActiveRecord end end + ARRAY_ESCAPE = "\\" * 2 * 2 # escape the backslash twice for PG arrays + def quote_and_escape(value) case value when "NULL", Numeric value else - "\"#{value.gsub(/"/,"\\\"")}\"" + value = value.gsub(/\\/, ARRAY_ESCAPE) + value.gsub!(/"/,"\\\"") + "\"#{value}\"" end end |