Sha256: 49f818fde55c634bce2bd514f7a1398fb80839c98479fe0ed97a34f26a0d8c52

Contents?: true

Size: 833 Bytes

Versions: 13

Compression:

Stored size: 833 Bytes

Contents

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


module PactBroker
  module Repositories
    class TagRepository

      include 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

13 entries across 13 versions & 1 rubygems

Version Path
pact_broker-1.15.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.14.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.13.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.12.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.11.2 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.11.1 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.11.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.10.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.9.3 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.9.2 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.9.1 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.9.0 lib/pact_broker/repositories/tag_repository.rb
pact_broker-1.9.0.rc1 lib/pact_broker/repositories/tag_repository.rb