Outputting SQL to page

Peter D Bethke
2011-03-09T15:32:45Z

Hi,

I''m interested in just outputting the SQL from a AR find() construct to
the page - without having to look at the console. I tried doing this:

self.joins(...)\
      	.select(...)\
      	.where(...)\
      	.order(...)\
      	.to_s

thinking that it would output the sql as a string, but its just an AR object
apparently. (note - I removed the particulars of the query for this example but
they work fine and the query is visible in the console).

Any ideas? Newbie, obviously and working _really_ hard to embrace non-hand coded
SQL. :)

Thanks!

Peter