Sha256: 6823fb75a4281e7c9f0438fd5d3d2ce502ae343f61608a665caf200cfbe24b4f
Contents?: true
Size: 919 Bytes
Versions: 36
Compression:
Stored size: 919 Bytes
Contents
require 'pact_broker/repositories' module PactBroker module Tags module Service extend self extend PactBroker::Repositories def create args pacticipant = pacticipant_repository.find_by_name_or_create args.fetch(:pacticipant_name) version = version_repository.find_by_pacticipant_id_and_number_or_create pacticipant.id, args.fetch(:pacticipant_version_number) tag_repository.create version: version, name: args.fetch(:tag_name) end def find args tag_repository.find args end def delete args version = version_repository.find_by_pacticipant_name_and_number args.fetch(:pacticipant_name), args.fetch(:pacticipant_version_number) connection = PactBroker::Domain::Tag.new.db connection.run("delete from tags where name = '#{args.fetch(:tag_name)}' and version_id = '#{version.id}'") end end end end
Version data entries
36 entries across 36 versions & 1 rubygems