title: How to access a nested hash value when performing a sql query in Rails?
body: <p>The column with the nested hash looks like this and I would like to access <em>language</em> key from the <em>subscription</em> column</p>
  
  <pre><code>=&gt; #&lt;User:0x00007fc609916ac8
   id: "224cc26e-6a66-43a0-96db7d3775ac",
   name: "Jack Ryan",
   email: "jack@ryan.com",
   subscription: {"plan"=&gt;"paid", "language"=&gt;"English", "country"=&gt;"Germany" },
  </code></pre>
  
  <p>Would appreciate any help on this. Thanks</p>
  
  <p>I have tried accessing it in few different ways but keep getting error </p>
  
  <pre><code>ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column users.subscription['language'] does not exist
  </code></pre>
  
  <pre><code>ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column users.subscription.language does not exist
  </code></pre>
  
  <pre><code>ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column users.subscription[:language] does not exist
  </code></pre>