Is your plugin hosted on GitHub? Make sure to press the "fetch" button next to the repository field to fetch your plugin's info from GitHub rather than typing it all in.
Repository
Name
Home Page
Short description Appends information about row counts to the log
Description This plugin offers rich information about result sets to AR logs. === Usage Just enjoy Rails as usual. === Example Consider some read operations like this. Member.count Member.find(:all) That usually makes following log. SQL (0.000300) SELECT count(*) AS count_all FROM members Member Load (0.000482) SELECT * FROM members RowsLogger appends information about rows count to the log. SQL (0.000301) (1 Row) SELECT count(*) AS count_all FROM members Member Load (0.000415) (3 Rows) SELECT * FROM members === For Developpers This plugin modfies following methods. 'ConnectionAdapters::AbstractAdapter#log' 'ConnectionAdapters::AbstractAdapter#log_info' ConnectionAdapters::AbstractAdapter#log --> log_info(sql, name, seconds) ConnectionAdapters::AbstractAdapter#log --> log_info(sql, name, seconds, result = nil) --> log_result_info(result) --> ConcreteAdapter#count_result(result) ConnectionAdapters::MysqlAdapter#count_result protected def count_result(result) result.num_rows end === Count Result Method The 'count_result' method of Adapter class should return count of result set from 'result' object, where 'result' is an object generated by 'log' method. This is used as result information. For exmaple, although this is nonsencial definition, def count_result(result) 0 end this code always appends "(0 Rows)" to the log. The returned value is directly used even if it is not a numeric value. But no information will be appended in following cases. 1) when 'count_result' method returns nil 2) when 'count_result' method is not defined in current adapter === Note 'count_result' method should be defined as 'protected' or 'public' because we check whether it is implemented or not in current adapter by using 'respond_to?' method.
Description format RDoc MarkDown Textile
License Ruby's Rails' (MIT) GPL LGPL BSD Apache Artistic PublicDomain BSD-type Free-Trial Free-but-Restricted OpenSource Proprietary Shareware Source-available-proprietary Commercial
Category Assets Controllers Internationalization Misc. Enhancements Model Rails Engines Searching and Queries Security Statistics and Logs Testing View Extensions