title: Rails view activerecord sql statements on debug console
body: <p>I am using <a href="https://github.com/cldwalker/debugger" rel="nofollow noreferrer">debugger</a> gem in my Rails 3.2 application.</p>
  
  <p>How do I view the resulting SQL statement of active record method calls on the debug console? </p>
  
  <p>For eg: If I run <code>Product.all</code> on the debug console it prints out all the products. I would also like to see the <code>"Select * from Products"</code> as well. Is this possible?</p>
  
  <p>Edit
  Now that I am wiser(;p) active record also provides .to_sql method on the active record relation objects, to inspect the sql queries that they run against the underlying database.</p>