
This adds /repo/{repository.id}/settings endpoints for reading and updating repo settings. Main points: 1. Sets up Settings as a first class resource instead of as an attribute of Repository 2. Adds new meta-programmed method to Query for accessing all prefixed params as a hash.
16 lines
387 B
Ruby
16 lines
387 B
Ruby
module Travis::API::V3
|
|
class Queries::Settings < Query
|
|
params :builds_only_with_travis_yml, :build_pushes, :build_pull_requests, :maximum_number_of_builds, prefix: :settings
|
|
|
|
def find(repository)
|
|
Models::Settings.new(repository)
|
|
end
|
|
|
|
def update(repository)
|
|
settings = find(repository)
|
|
settings.update(settings_params)
|
|
settings
|
|
end
|
|
end
|
|
end
|