From 779ff5cdeb8aa1cffb112e0d40baa57b33a29844 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sat, 17 May 2014 00:25:04 +0200 Subject: [PATCH] doc, pg `hstore` and `json` columns are mapped as `Hash`. [ci skip] Closes #15141. --- guides/source/upgrading_ruby_on_rails.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index bb194d667e..30eb89ede8 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -393,6 +393,14 @@ start using the more precise `:plain:`, `:html`, and `:body` options instead. Using `render :text` may pose a security risk, as the content is sent as `text/html`. +### PostgreSQL json and hstore datatypes + +Rails 4.1 will map `json` and `hstore` columns to a string-keyed Ruby `Hash`. +In earlier versions a `HashWithIndifferentAccess` was used. This means that +symbol access is no longer supported. This is also the case for +`store_accessors` based on top of `json` or `hstore` columns. Make sure to use +string keys consistently. + Upgrading from Rails 3.2 to Rails 4.0 -------------------------------------