Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :cacheable option to reportable #25

Closed
wants to merge 4 commits into from
Closed

Add :cacheable option to reportable #25

wants to merge 4 commits into from

Conversation

hdm
Copy link
Contributor

@hdm hdm commented Jan 13, 2013

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

@hdm hdm closed this Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant