Sha256: e8cae84ea759d8381a5950d46f71bf19bda0fb1bbe448d21977c45e352118726

Contents?: true

Size: 916 Bytes

Versions: 17

Compression:

Stored size: 916 Bytes

Contents

require "pact_broker/logging"
require "pact_broker/repositories"
require "pact_broker/messages"

module PactBroker
  module Versions
    class BranchService
      extend PactBroker::Repositories

      def self.find_branch_version(pacticipant_name:, branch_name:, version_number:, **)
        BranchVersion.where(
          version: PactBroker::Domain::Version.where_pacticipant_name_and_version_number(pacticipant_name, version_number),
          branch: Branch.where(name: branch_name)
        ).single_record
      end

      def self.find_or_create_branch_version(pacticipant_name:, branch_name:, version_number:, **)
        pacticipant = pacticipant_repository.find_by_name_or_create(pacticipant_name)
        version = version_repository.find_by_pacticipant_id_and_number_or_create(pacticipant.id, version_number)
        branch_version_repository.add_branch(version, branch_name)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pact_broker-2.94.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.93.4 lib/pact_broker/versions/branch_service.rb
pact_broker-2.93.3 lib/pact_broker/versions/branch_service.rb
pact_broker-2.93.2 lib/pact_broker/versions/branch_service.rb
pact_broker-2.93.1 lib/pact_broker/versions/branch_service.rb
pact_broker-2.93.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.92.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.91.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.90.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.89.1 lib/pact_broker/versions/branch_service.rb
pact_broker-2.89.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.88.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.87.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.86.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.85.1 lib/pact_broker/versions/branch_service.rb
pact_broker-2.85.0 lib/pact_broker/versions/branch_service.rb
pact_broker-2.84.0 lib/pact_broker/versions/branch_service.rb