Given an ActiveRecord method or named_scope
chain, is there a way to return the SQL that will get executed, without actually running it?
e.g.
Vote.positive.count.sql #=> "SELECT COUNT(*) FROM votes WHERE value > 0"
Is there a built-in way to do this or a plug-in that offers this functionality? If not, any clues to where I can start to build my own plug-in or at least a solution for this current project.
Cheers