saulabs/reportable — pull request #25 by hmoore-r7 (2013-01-13 02:45:11+00:00)
Title: Add :cacheable option to reportable

This configures specific reports to always skip the cache. This is useful when the same report option is called with multiple conditions throughout the application. Without :cacheable => false, a report will return the wrong results when called with different conditions.

For example:

Widget.hourly_report() # Works as expected
@box.widgets.hourly_report() # Uses the cache result from the *global* report above

This patch enables the above when :cacheable => false is specified:
class Widget < ActiveRecord::Base
reportable :hourly, :aggregation => :count, :grouping => :hour, :live_data => true, :cacheable => false
end