title: using multiple scope params in Rails3
body: <p>In my Rails3 app I have AR scope which requires 3 parameters</p>
  
  <p>Ex: I'm trying to get an error details for a given module between two code values</p>
  
  <pre><code>#select * from error_codes where error_module_id=1 and code &gt;0 and code &lt; 100
  
  scope :latest_error_code, lambda{ |module_id, min, max|
      {:conditions =&gt; "error_module_id=#{module_id} and code &gt;= #{min} and code &lt;= #{max}"}
  } 
  </code></pre>
  
  <p>in my console I do</p>
  
  <pre><code>ErrorCode.latest_error_code(1,0,100)
  </code></pre>
  
  <p>But when I try to execute this, I'm getting the following error</p>
  
  <pre><code>multiple values for a block parameter (3 for 1)
  </code></pre>
  
  <p>and when i did some goggling, it appears to be that AR scope doent support multiple parameters</p>
  
  <p>1 - is it true? (AR doent support multiple params for scope)
  2 - Is there any other alternative?
  3 - Am I doing something wrong here?</p>
  
  <p>thanks in advance</p>