cleanup unused report stuff

refs CNVS-3134

test plan
 - specs should pass

Change-Id: I7eea877609c50e4014c1b80a085c3fba33b32ced
Reviewed-on: https://gerrit.instructure.com/36069
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Rob Orton 2014-06-08 13:03:02 -06:00
parent f4858b3b41
commit 2c1e67b234
2 changed files with 2 additions and 17 deletions

View File

@ -841,7 +841,7 @@ acknowledge that you have read and agreed to the
<th class="reports"></th>
</tr>
<% @available_reports.sort_by {|_, details| details.title}.each do |report, details|
title = details.title || details
title = details.title
description_partial = details[:description_partial]
description_partial = report + '_description' if description_partial == true
parameters_partial = details[:parameters_partial]

View File

@ -25,11 +25,7 @@ module Canvas::AccountReports
class Report < Struct.new(:title, :description_partial, :parameters_partial, :parameters, :module, :proc)
def title
if (title = super).is_a? String
title
else
title.call
end
super.call
end
end
@ -42,17 +38,6 @@ module Canvas::AccountReports
end
end
# account id is ignored; use PluginSetting to enable a subset of reports
def self.add_account_reports(account_id, module_name, reports)
reports.each do |report_type, details|
details = {:title => details} if details.is_a? String
details[:module] ||= module_name
details[:proc] ||= "Canvas::AccountReports::#{module_name}".constantize.method(report_type)
report = Report.new(details[:title], details[:description_partial], details[:parameters_partial], details[:parameters], details[:module], details[:proc])
REPORTS[report_type] = report
end
end
def self.available_reports
settings = Canvas::Plugin.find(:account_reports).settings
return REPORTS.dup unless settings