Links
ActiveRecord IO Mode Plugin
Categories
ActiveRecord IO Mode Plugin
Redirect 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
Vitals
| Home | http://www.mktec.com/oss/rails-plugins/ |
|---|---|
| License | BSD-type |
| Rating | (3 votes) |
| Owner | Zach Dennis |
| Created | 22 April 2006 |
