aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 563f98dc5e..c26b61443b 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -51,7 +51,10 @@ module ActiveRecord
end
def cast_hstore(string)
- Hash[[string.split('=>').map { |k| k[1...-1] }]]
+ kvs = string.split(', ').map { |kv|
+ kv.split('=>').map { |k| k[1...-1] }
+ }
+ Hash[kvs]
end
end
# :startdoc: