Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AuthenticationMixin] authentication_status to virtual_delegate #18196

Commits on Nov 15, 2018

  1. [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`.
    NickLaMuro committed Nov 15, 2018
    Configuration menu
    Copy the full SHA
    49d854d View commit details
    Browse the repository at this point in the history