title: How to query multi values of enum field in ActiveRecord?
body: <p>mymodel.rb</p>
  
  <pre><code>enum status: { posted: 1, failed: 2, suspended: 3 }
  </code></pre>
  
  <p>mycontroller.rb</p>
  
  <pre><code>def filter_params
    params.fetch(:mymodel, {}).
    permit(
      :status =&gt; []
      )
  end
  </code></pre>
  
  <p>And i have params like <code>mymodel[:status] =&gt; ["failed", "suspended"]</code></p>
  
  <p>How can i get all results by status is <code>failed</code> and <code>suspended</code></p>
  
  <p>Something like: <code>Mymodel.where(status: filter_params[:status])</code></p>
  
  <p>Thanks a lot!</p>
  
  <p>And when a call:</p>
  
  <pre><code>@mymodel = Mymodel.new(filter_params)
  </code></pre>
  
  <p>I got this error:</p>
  
  <pre><code>'["failed", "suspended"]' is not a valid status
  </code></pre>