aliceborie/ReportingApp — pull request #2 by profh (2014-07-01 22:06:50+00:00)
Title: Adding *_using_(db) methods for class methods

As discussed earlier, if a model extends QueryExecutor then all the class methods will be extended with a _using_(db) method. The db is assumed to be a sqlite db and line 36 of the QueryExecutor module appends a .sqlite3 extension; if moving to MySQL or Postgres then remove the extension from that line. Informally tested in console with VisitAction.pageviews('AppBuilder') => 3; VisitAction.pageviews_using_log('AppBuilder') => 1 (I modified the log db so one record matches); VisitAction.pageviews_using_relog('AppBuilder') => Exceptions::QueryNotExecuted (relog.sqlite3 db doesn't exist). More formal testing is obviously required. Contact me if you have more questions about this.