title: Querying nested jsonb hash in rails
body: <p>I am storing jsonb on Model#data field with following structure in rails</p>
  
  <pre><code>{
   $action_id1: {
     $user_id1: [1,2,3],
     $user_id2: [1,2,3],
     $user_id3: [1,2,3]
   },
   $action_id2: {
     $user_id1: [1,2,3],
     $user_id4: [1,2,3],
     $user_id3: [1,2,3]
   },
   $action_id2: {
     $user_id1: [1,2,3],
     $user_id2: [1,2,3],
     $user_id3: [1,2,3]
   }
  }
  </code></pre>
  
  <p>How can I query the <code>data</code> field to get all records where <code>$user_id2</code> key exists irrespective of <code>actiod_id</code> key.</p>