Class: PactBroker::Domain::Pacticipant
Instance Method Summary
collapse
call, #generate_display_name
Methods included from Messages
#message, #pluralize, #potential_duplicate_pacticipant_message, #validation_message
Instance Method Details
#any_versions? ⇒ Boolean
102
103
104
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 102
def any_versions?
PactBroker::Domain::Version.where(pacticipant: self).any?
end
|
#before_save ⇒ Object
92
93
94
95
96
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 92
def before_save
super
self.display_name = generate_display_name(name) if display_name.blank?
self.main_branch = nil if main_branch.blank?
end
|
#branch_head_for(branch_name) ⇒ Object
106
107
108
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 106
def branch_head_for(branch_name)
branch_heads.find{ | branch_head | branch_head.branch_name == branch_name }
end
|
#label?(name) ⇒ Boolean
110
111
112
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 110
def label?(name)
labels.any? { |label| label.name == name }
end
|
#to_s ⇒ Object
98
99
100
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 98
def to_s
"Pacticipant: id=#{id}, name=#{name}"
end
|