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

disambiguate columns used in query ordering #1893

Merged
merged 1 commit into from
Oct 5, 2020

Commits on Oct 4, 2020

  1. disambiguate columns used in query ordering

    Queries using the named ordering options and also joins with other
    tables were failing with:
    
      ActionView::Template::Error: PG::AmbiguousColumn:
      ERROR:  column reference "id" is ambiguous
      LINE 1: SELECT DISTINCT cookbook_followers_count, id AS alias_0, "c…
                                                        ^
    
    Database query was traced to these ordering options in the Cookbook
    scopes.
    
    Added tests for the API route and query parameters that triggered these
    errors. Added tablenames to the column references to pass the tests.
    
    Signed-off-by: Robb Kidd <rkidd@chef.io>
    robbkidd committed Oct 4, 2020
    Configuration menu
    Copy the full SHA
    c8860ac View commit details
    Browse the repository at this point in the history