Class: PactBroker::Domain::Pacticipant
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- PactBroker::Domain::Pacticipant
show all
- Includes:
- Messages
- Defined in:
- lib/pact_broker/domain/pacticipant.rb
Instance Method Summary
collapse
Methods included from Messages
#message, #potential_duplicate_pacticipant_message, #validation_message
Instance Method Details
#before_destroy ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 32
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
|
#latest_version ⇒ Object
41
42
43
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 41
def latest_version
versions.last
end
|
#to_s ⇒ Object
45
46
47
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 45
def to_s
"Pacticipant: id=#{id}, name=#{name}"
end
|
#validate ⇒ Object
49
50
51
52
53
|
# File 'lib/pact_broker/domain/pacticipant.rb', line 49
def validate
messages = []
messages << message('errors.validation.attribute_missing', attribute: 'name') unless name
messages
end
|