diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-23 19:06:01 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-23 19:06:04 -0300 |
commit | e96fa8987b0a2c21604c0b5aeb78bedfac5e1faa (patch) | |
tree | eceb0d53b6337dd63fcdc9d34a5d71842c1b312a /activerecord/lib/active_record/connection_adapters/postgresql/cast.rb | |
parent | 31388fa79223ea04dc67fd775c4fa04aadabe067 (diff) | |
parent | 2c9304891ef264409980abfac499f698876744d0 (diff) | |
download | rails-e96fa8987b0a2c21604c0b5aeb78bedfac5e1faa.tar.gz rails-e96fa8987b0a2c21604c0b5aeb78bedfac5e1faa.tar.bz2 rails-e96fa8987b0a2c21604c0b5aeb78bedfac5e1faa.zip |
Merge branch 'jlxw-patch-2'
Closes #9184
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/cast.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/cast.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb index 3d8f0b575c..fcbd8fd88a 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb @@ -30,8 +30,8 @@ module ActiveRecord nil elsif String === string Hash[string.scan(HstorePair).map { |k,v| - v = v.upcase == 'NULL' ? nil : v.gsub(/^"(.*)"$/,'\1').gsub(/\\(.)/, '\1') - k = k.gsub(/^"(.*)"$/,'\1').gsub(/\\(.)/, '\1') + v = v.upcase == 'NULL' ? nil : v.gsub(/\A"(.*)"\Z/m,'\1').gsub(/\\(.)/, '\1') + k = k.gsub(/\A"(.*)"\Z/m,'\1').gsub(/\\(.)/, '\1') [k,v] }] else |