Sha256: 78ea0096cd9319bd8f2623b8a99892829b5c20c0fe4b8860c7643f81f39f65da

Contents?: true

Size: 740 Bytes

Versions: 7

Compression:

Stored size: 740 Bytes

Contents

require 'pact_broker/domain/tag'

module PactBroker
  module Repositories
    class TagRepository


      def create args
        Domain::Tag.new(name: args.fetch(:name), version: args.fetch(:version)).save
      end

      def find args
        PactBroker::Domain::Tag
          .select(:tags__name, :tags__version_id, :tags__created_at, :tags__updated_at)
          .join(:versions, {id: :version_id})
          .join(:pacticipants, {pacticipants__id: :versions__pacticipant_id})
          .where(:tags__name => args.fetch(:tag_name))
          .where(:versions__number => args.fetch(:pacticipant_version_number))
          .where(:pacticipants__name => args.fetch(:pacticipant_name))
          .single_record
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pact_broker-1.8.1 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.8.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.7.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.6.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.5.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.4.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.3.2.rc1 lib/pact_broker/repositories/tag_repository.rb