forked from ManageIQ/manageiq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AuthenticationMixin] authentication_status to virtual_delegate
Creates a virtual_delegate for AuthenticationMixin#authentication_status which allows it to be included in reports and put in as part of the main query. The biggest thing of note in this change is how the status_severity_arel is being used to handle the sorting properly in the SQL query. It makes use of a SQL's case statement to handle what would normally be a `sort_by` on the hash lookup of Authentication::STATUS_SEVERITY. Instead, we match each key to the status column and use that as the value for the `ORDER BY exp DESC` in the `has_one`, which allows for the same affect. This also means that it can inject itself in the `SELECT` of a `MiqReport`, and avoid N+1's on things like quadicons and such for pages that use `MiqReport#paged_view_search`.
- Loading branch information
1 parent
ed18040
commit 49d854d
Showing
3 changed files
with
105 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters