make repos sortable on default_branch.current_build
This commit is contained in:
parent
e876a83d86
commit
e558671e3c
|
@ -426,6 +426,3 @@ DEPENDENCIES
|
|||
travis-yaml!
|
||||
unicorn
|
||||
yard-sinatra!
|
||||
|
||||
BUNDLED WITH
|
||||
1.11.2
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
module Travis::API::V3
|
||||
class Queries::Repositories < Query
|
||||
params :active, :private, :starred, prefix: :repository
|
||||
sortable_by :id, :github_id, :owner_name, :name, active: sort_condition(:active), :'default_branch.last_build' => 'builds.started_at'
|
||||
|
||||
# TODO this looks like a leftover from a mergeconflict, maybe?
|
||||
# see lib/travis/api/v3/query.rb#58
|
||||
#
|
||||
# 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"
|
||||
:'default_branch.current_build' => 'builds.started_at',
|
||||
:current_build => '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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user