travis-api/lib/travis/api/v3/queries/branches.rb
2015-10-13 12:33:26 +02:00

14 lines
326 B
Ruby

module Travis::API::V3
class Queries::Branches < Query
sortable_by :name,
last_build: "builds.started_at".freeze,
exists_on_github: "(case when branches.exists_on_github then 1 else 2 end)".freeze
default_sort "last_build:desc"
def find(repository)
sort repository.branches
end
end
end