title: Rails 3: Use of lambda with scopes in model
body: <p>Hi I'm currently reading Rails Recipes and there's one section where the author uses scopes in the model so that the controller has access to certain query fragments without adding queries to the controller (and therefore violating the MVC rules). At one point he has this:</p>
  
  <pre><code>class Wombat &lt; ActiveRecord::Base
    scope :with_bio_containing, lambda {|query| where("bio like ?", "%#{query}%").
                                           order(:age) }
  end
  </code></pre>
  
  <p>I've never used lambda and Proc objects. Is this the equivalent of adding an argument to the scope so that conceptually it's <code>scope :with_bio_containing(query)</code> and therefore allowing me to customize the scope as if it were a function? Is lambda commonly used in scopes in Rails?</p>