title: How do I add a custom predicate-builder in Rails 5?
body: <p>In Rails 4, If I had an <code>ArrayLikeClass</code> class and I wanted to use its objects in where queries like <code>Model.where(id: instance_of_array_like_class)</code>, I could do so by registering a predicate-builder:</p>
  
  <pre><code>ActiveRecord::PredicateBuilder.register_handler(ArrayLikeClass, ActiveRecord::PredicateBuilder::ArrayHandler.new)
  </code></pre>
  
  <p>after which instances of <code>ArrayLikeClass</code> would behave same as instances of <code>Array</code> when used in where queries.</p>
  
  <p>However, with Rails 5, the API is changed and <code>ActiveRecord::PredicateBuilder::ArrayHandler.new</code> now requires an instance of <code>ActiveRecord::PredicateBuilder</code>. Also <code>register_handler</code> is now an <em>instance method</em> in <code>ActiveRecord::PredicateBuilder</code>.</p>
  
  <p>So, how can I register a predicate-builder handler in Rails 5 for a custom class?</p>