title: Is there a way to serialize ActiveRecord's JSON properties using HashWithIndifferentAccess?
body: <p>I am using <code>ActiveRecord::ConnectionAdapters::PostgreSQLAdapter</code> in a Rails application.  Suppose I have a schema:</p>
  
  <pre><code>  create_table "foo", id: :bigserial, force: :cascade do |t|
      t.string   "name"
      t.jsonb    "data",              null: false
    end
  </code></pre>
  
  <p>Now suppose I run the following code:</p>
  
  <pre><code>class Foo &lt; ActiveRecord::Base
    self.table_name = :foo
  end
  
  my_foo = Foo.create!(:name =&gt; 'foobar', :data =&gt; {:a =&gt; 'hello'})
  my_foo = Foo.where(:name =&gt; 'foobar').first!
  puts my_foo.data[:a]
  puts my_foo.data['a']
  </code></pre>
  
  <p>The output would be:</p>
  
  <pre><code># nil
  # 'hello'
  </code></pre>
  
  <p>Is it possible to ask ActiveRecord to automatically deserialize jsonb types using HashWithIndifferentAccess?</p>