title: Nested scopes in Rails 3.1
body: <p>Is there a way that I can convert the to_be_approved by method in the following code to be a scope that uses the two other scopes?</p>
  
  <pre><code>scope :reports_to, lambda { |manager| 
    joins(" JOIN admin_users request_user on requests.admin_user_id = request_user.id and request_user.manager_id = #{manager.id} ") }
  scope :pending, joins(:admin_request_status).where('admin_request_statuses.name = ?','Pending Approval')
  
  def self.to_be_approved_by( manager )
    reports_to(manager).pending
  end
  </code></pre>
  
  <p>I also want to get rid of the embedded sql in the reports_to scope, but that is a whole different question :)</p>