class PactBroker::Domain::Pacticipant
Public Instance Methods
Source
# File lib/pact_broker/domain/pacticipant.rb, line 73 def any_versions? PactBroker::Domain::Version.where(pacticipant: self).any? end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 54 def before_destroy PactBroker::Pacts::PactPublication.where(provider: self).delete PactBroker::Domain::Verification.where(consumer: self).or(provider: self).delete PactBroker::Domain::Version.where(pacticipant: self).delete PactBroker::Pacts::PactVersion.where(consumer: self).or(provider: self).delete PactBroker::Domain::Label.where(pacticipant: self).destroy super end
Calls superclass method
Source
# File lib/pact_broker/domain/pacticipant.rb, line 63 def before_save super self.display_name = generate_display_name(name) if display_name.blank? self.main_branch = nil if main_branch.blank? end
Calls superclass method
Source
# File lib/pact_broker/domain/pacticipant.rb, line 77 def branch_head_for(branch_name) branch_heads.find{ | branch_head | branch_head.branch_name == branch_name } end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 45 def find_by_name(name) where(name_like(:name, name)) end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 40 def label label_name filter = name_like(Sequel[:labels][:name], label_name) join(:labels, {pacticipant_id: :id}).where(filter) end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 81 def label?(name) labels.any? { |label| label.name == name } end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 69 def to_s "Pacticipant: id=#{id}, name=#{name}" end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 49 def where_name(name) where(name_like(:name, name)) end
Source
# File lib/pact_broker/domain/pacticipant.rb, line 36 def with_main_branch_set exclude(main_branch: nil) end