title: How to search array through ransack gem?
body: <p>I'm using <code>ransack gem</code> for searching in rails application. I need to search an array of <code>email_ids</code> in <code>User</code> table.</p>
  
  <p>Referring to <a href="https://github.com/activerecord-hackery/ransack/issues/321" rel="nofollow noreferrer">this</a> issue at ransacking, I followed the steps and added this to the initializers folder <code>ransack.rb</code></p>
  
  <pre><code>Ransack.configure do |config|
     {
      contained_within_array: :contained_within,
      contained_within_or_equals_array: :contained_within_or_equals,
      contains_array: :contains,
      contains_or_equals_array: :contains_or_equals,
      overlap_array: :overlap
     }.each do |rp, ap|
     config.add_predicate rp, arel_predicate: ap, wants_array: true
    end
  end
  </code></pre>
  
  <p>In the rails console, if i do like this:</p>
  
  <pre><code>a = User.search(email_contains_array: ['priti@gmail.com'])
  </code></pre>
  
  <p>it produces the sql like this:</p>
  
  <pre><code>"SELECT \"users\".* FROM \"users\" WHERE \"users\".\"deleted_at\" IS NULL AND (\"users\".\"email\" &gt;&gt; '---\n- priti@gmail.com\n')"
  </code></pre>
  
  <p>and gives error like this:</p>
  
  <pre><code>  User Load (1.8ms)  SELECT "users".* FROM "users" WHERE "users"."deleted_at" IS NULL AND ("users"."email" &gt;&gt; '---
  - priti@gmail.com
  ')
   ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: operator does not exist: character varying &gt;&gt; unknown
   LINE 1: ...RE "users"."deleted_at" IS NULL AND ("users"."email" &gt;&gt; '---
                                                              ^
   HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
   : SELECT "users".* FROM "users" WHERE "users"."deleted_at" IS NULL AND ("users"."email" &gt;&gt; '---
   - priti@gmail.com
  ')
  </code></pre>
  
  <p>Expected is this query: </p>
  
  <pre><code>SELECT "users".* FROM "users"  WHERE ("users"."roles" @&gt; '{"3","4"}')
  </code></pre>
  
  <p>What is wrong am I doing?</p>