Sha256: 64e13e4379f9236109e1a4325cb0446eb9c9693a035c05c1351127e31f763bad

Contents?: true

Size: 848 Bytes

Versions: 12

Compression:

Stored size: 848 Bytes

Contents

require 'pact_broker/domain/tag'
require 'pact_broker/repositories/helpers'


module PactBroker
  module Tags
    class Repository

      include PactBroker::Repositories::Helpers

      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(name_like(:tags__name, args.fetch(:tag_name)))
          .where(name_like(:versions__number, args.fetch(:pacticipant_version_number)))
          .where(name_like(:pacticipants__name, args.fetch(:pacticipant_name)))
          .single_record
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.0.0.beta.6 lib/pact_broker/tags/repository.rb
pact_broker-1.18.0 lib/pact_broker/tags/repository.rb
pact_broker-2.0.0.beta.5 lib/pact_broker/tags/repository.rb
pact_broker-1.18.0.beta.1 lib/pact_broker/tags/repository.rb
pact_broker-1.17.2 lib/pact_broker/tags/repository.rb
pact_broker-1.17.1 lib/pact_broker/tags/repository.rb
pact_broker-2.0.0.beta.4 lib/pact_broker/tags/repository.rb
pact_broker-2.0.0.beta.3 lib/pact_broker/tags/repository.rb
pact_broker-2.0.0.beta.2 lib/pact_broker/tags/repository.rb
pact_broker-2.0.0.beta.1 lib/pact_broker/tags/repository.rb
pact_broker-1.17.0 lib/pact_broker/tags/repository.rb
pact_broker-1.16.0 lib/pact_broker/tags/repository.rb