From dbe0a75a22b64a0b1ea60bff3ca90f8160399a75 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 6 Jun 2016 14:12:00 +0200 Subject: [PATCH] Specify a table when sorting by current_build_id Otherwise in some circumstances postgres may complain about disambiguity. --- lib/travis/api/v3/queries/repositories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/v3/queries/repositories.rb b/lib/travis/api/v3/queries/repositories.rb index 7132fb00..1f45299c 100644 --- a/lib/travis/api/v3/queries/repositories.rb +++ b/lib/travis/api/v3/queries/repositories.rb @@ -4,7 +4,7 @@ module Travis::API::V3 sortable_by :id, :github_id, :owner_name, :name, active: sort_condition(:active), :'default_branch.last_build' => 'builds.started_at' sortable_by :id, :github_id, :owner_name, :name, active: sort_condition(:active), :'default_branch.last_build' => 'builds.started_at', - :current_build => "current_build_id %{order} NULLS LAST" + :current_build => "repositories.current_build_id %{order} NULLS LAST" def for_member(user, **options) all(user: user, **options).joins(:users).where(users: user_condition(user), invalidated_at: nil)