Add API support for querying admin reports by date range

This commit is contained in:
Robin Ward
2014-11-05 13:11:23 -05:00
parent fde5e739c9
commit 068d22e9b3
5 changed files with 11 additions and 12 deletions

View File

@ -39,8 +39,8 @@ class Report
# Load the report
report = Report.new(type)
report.start_date = opts[:start_date]
report.end_date = opts[:end_date]
report.start_date = opts[:start_date] if opts[:start_date]
report.end_date = opts[:end_date] if opts[:end_date]
send(report_method, report)
report
end
@ -70,7 +70,7 @@ class Report
end
def self.report_about(report, subject_class, report_method = :count_per_day)
basic_report_about report, subject_class, report_method, default_days
basic_report_about report, subject_class, report_method, report.start_date, report.end_date
add_counts(report, subject_class)
end