title: How to delete row from Ruby Sequel table based on two conditions
body: <p>I have a table (Device) that I am using Ruby to access.  I want to delete a row if it fulfills these two conditions:  </p>
  
  <pre><code>{:user_id =&gt; params[:user_id]}
  </code></pre>
  
  <p>and </p>
  
  <pre><code>{:reg_token =&gt; params[:reg_token]}
  </code></pre>
  
  <p>However, I'm not sure if I know how to use <code>AND</code> correctly.  I am trying to follow this guide:  </p>
  
  <p><a href="http://sequel.jeremyevans.net/rdoc/files/doc/dataset_filtering_rdoc.html" rel="nofollow noreferrer">http://sequel.jeremyevans.net/rdoc/files/doc/dataset_filtering_rdoc.html</a></p>
  
  <pre><code>if Device.where{Sequel.&amp;({:user_id =&gt; params[:user_id]}, {:reg_token =&gt; params[:reg_token]})}.count &gt; 0
      # device = Device.where((:user_id =&gt; params[:user_id]) &amp; (:reg_token =&gt; params[:reg_token])).delete
      device = Device.where{Sequel.&amp;({:user_id =&gt; params[:user_id]}, {:reg_token =&gt; params[:reg_token]})}.delete
  end
  </code></pre>