title: Conditional Proc in ruby/rails?
body: <p>Proc is used in our code for selecting records. Here is an example:</p>
  
  <pre><code>Proc.new { models.where('payment_requestx_payment_requests.paid = ?',  params[:paid_s] == 'true')}
  </code></pre>
  
  <p>We are looking for a way to run this <code>Proc</code> if a simple condition is met. Otherwise skip the <code>Proc</code> if condition returns false. Something like:</p>
  
  <pre><code>Proc.new { models.where('payment_requestx_payment_requests.paid = ?',  params[:paid_s] == 'true') if params[:condition] == 'true' }
  </code></pre>
  
  <p>The condition has to be inside the <code>Proc</code>. Is this something doable in ruby/rails? </p>