Skip to content

Commit

Permalink
Merge pull request #454 from hstastna/Order_Chargeback_reports_desc
Browse files Browse the repository at this point in the history
Change ordering of Saved Chargeback reports
(cherry picked from commit 1613524)

https://bugzilla.redhat.com/show_bug.cgi?id=1430439
  • Loading branch information
Dan Clarizio authored and simaishi committed Mar 8, 2017
1 parent 15181e4 commit e532b26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/chargeback_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def cb_rpts_get_all_reps(nodeid)
miq_report = MiqReport.find(@sb[:miq_report_id])
saved_reports = miq_report.miq_report_results.with_current_user_groups
.select("id, miq_report_id, name, last_run_on, report_source")
.order(:last_run_on)
.order(:last_run_on => :desc)

@sb[:tree_typ] = "reports"
@right_cell_text = _("Report \"%{report_name}\"") % {:report_name => miq_report.name}
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/tree_builder_chargeback_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def x_get_tree_roots(count_only, _options)
def x_get_tree_custom_kids(object, count_only, _options)
objects = MiqReportResult.with_saved_chargeback_reports(from_cid(object[:id].split('-').first))
.select(:id, :miq_report_id, :name, :last_run_on, :miq_task_id)
.order(:last_run_on)
.order(:last_run_on => :desc)

count_only_or_objects(count_only, objects, "name")
end
Expand Down

0 comments on commit e532b26

Please sign in to comment.