lib/pact_broker/api/resources/pact.rb in pact_broker-2.52.2 vs lib/pact_broker/api/resources/pact.rb in pact_broker-2.53.0
- old
+ new
@@ -7,18 +7,10 @@
require 'pact_broker/pacts/pact_params'
require 'pact_broker/api/contracts/put_pact_params_contract'
require 'pact_broker/webhooks/execution_configuration'
require 'pact_broker/api/resources/webhook_execution_methods'
-module Webmachine
- class Request
- def patch?
- method == "PATCH"
- end
- end
-end
-
module PactBroker
module Api
module Resources
class Pact < BaseResource
include PacticipantResourceMethods
@@ -39,14 +31,10 @@
def allowed_methods
["GET", "PUT", "DELETE", "PATCH", "OPTIONS"]
end
- def known_methods
- super + ['PATCH']
- end
-
def is_conflict?
merge_conflict = request.patch? && resource_exists? &&
Pacts::Merger.conflict?(pact.json_content, pact_params.json_content)
potential_duplicate_pacticipants?(pact_params.pacticipant_names) || merge_conflict
@@ -106,13 +94,9 @@
@pact ||= pact_service.find_pact(pact_params)
end
def pact_params
@pact_params ||= PactBroker::Pacts::PactParams.from_request request, path_info
- end
-
- def update_matrix_after_request?
- request.put? || request.patch?
end
def set_post_deletion_response
latest_pact = pact_service.find_latest_pact(pact_params)
response_body = { "_links" => {} }