title: How can I see the SQL that will be generated by a given ActiveRecord query in Ruby on Rails
body: <p>I would like to see the SQL statement that a given ActiveRecord Query will generate.  I recognize I can get this information from the log after the query has been issued, but I'm wondering if there is a method that can be called on and ActiveRecord Query.</p>
  
  <p>For example:</p>
  
  <pre><code>SampleModel.find(:all, :select =&gt; "DISTINCT(*)", :conditions =&gt; ["`date` &gt; #{self.date}"], :limit =&gt; 1, :order =&gt; '`date`', :group =&gt; "`date`")
  </code></pre>
  
  <p>I would like to open the irb console and tack a method on the end that would show the SQL that this query will generate, but not necessarily execute the query.</p>