Sha256: 33fc364455448c2aff7ff3529f20dcce88d56599f38e2341cca91f1c7d8d5daa
Contents?: true
Size: 1.12 KB
Versions: 17
Compression:
Stored size: 1.12 KB
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(Sequel.qualify("tags", "name"), Sequel.qualify("tags", "version_id"), Sequel.qualify("tags", "created_at"), Sequel.qualify("tags", "updated_at")) .join(:versions, {id: :version_id}) .join(:pacticipants, {Sequel.qualify("pacticipants", "id") => Sequel.qualify("versions", "pacticipant_id")}) .where(name_like(Sequel.qualify("tags", "name"), args.fetch(:tag_name))) .where(name_like(Sequel.qualify("versions", "number"), args.fetch(:pacticipant_version_number))) .where(name_like(Sequel.qualify("pacticipants", "name"), args.fetch(:pacticipant_name))) .single_record end def delete_by_version_id version_id Sequel::Model.db[:tags].where(version_id: version_id).delete end end end end
Version data entries
17 entries across 17 versions & 1 rubygems