Plugins - ActiveRecord IO Mode Plugin
Add to favoritesRedirect the SQL statements that ActiveRecord generates to any object that responds to the method <<
Example:
# to redirect sql to an array
arr = [] ActiveRecord::Base.sendsqlto arr => true
# let's test it
Test.find :all, :limit => 1 => [] arr => ["SELECT * FROM tests LIMIT 1;\n"]
# redirect sql back to our db connection
ActiveRecord::Base.sendsqlto :db => true Test.find :all, :limit => 1 => [#"test1", "id"=>"1"}>]
Authors: Mark VanHolstyn, Zach Dennis
