You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: Actually, what I propose below is already possible but is not mentioned in the documentation! It seems like any of the options that can be defined when the report is declared with 'reportable' can be included in a hash at runtime.
Let's say I have a User model that has_many Posts and I would like to report on the Posts belonging to the current user (e.g. show the user how many posts they have submitted each day this month). This does not appear to be possible in the current version of reportable.
I can't add a condition based on current_user because it is evaluated when the class is loaded, e.g. the following does not work:
reportable :my, :conditions => ["user_id LIKE ?", current_user]
I would need to be able to specify conditions when the query is run, e.g.:
Posts.my_report(:conditions => ["user_id LIKE ?", current_user]).
The text was updated successfully, but these errors were encountered:
EDIT: Actually, what I propose below is already possible but is not mentioned in the documentation! It seems like any of the options that can be defined when the report is declared with 'reportable' can be included in a hash at runtime.
Let's say I have a User model that has_many Posts and I would like to report on the Posts belonging to the current user (e.g. show the user how many posts they have submitted each day this month). This does not appear to be possible in the current version of reportable.
I can't add a condition based on current_user because it is evaluated when the class is loaded, e.g. the following does not work:
I would need to be able to specify conditions when the query is run, e.g.:
The text was updated successfully, but these errors were encountered: