Class: PactBroker::Deployments::DeployedVersion
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- PactBroker::Deployments::DeployedVersion
- Defined in:
- lib/pact_broker/deployments/deployed_version.rb
Instance Method Summary collapse
- #after_create ⇒ Object
-
#application_instance ⇒ Object
target has been renamed to applicationInstance in the API.
- #application_instance=(application_instance) ⇒ Object
- #before_validation ⇒ Object
- #currently_deployed ⇒ Object
- #environment_name ⇒ Object
- #record_undeployed ⇒ Object
- #version_number ⇒ Object
Instance Method Details
#after_create ⇒ Object
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 78 def after_create super CurrentlyDeployedVersionId.new( pacticipant_id: pacticipant_id, environment_id: environment_id, version_id: version_id, target_for_index: target_for_index, deployed_version_id: id ).upsert end |
#application_instance ⇒ Object
target has been renamed to applicationInstance in the API.
94 95 96 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 94 def application_instance target end |
#application_instance=(application_instance) ⇒ Object
98 99 100 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 98 def application_instance= application_instance self.target = application_instance end |
#before_validation ⇒ Object
73 74 75 76 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 73 def before_validation super self.target_for_index = target.nil? ? "" : target end |
#currently_deployed ⇒ Object
89 90 91 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 89 def currently_deployed !!currently_deployed_version_id end |
#environment_name ⇒ Object
106 107 108 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 106 def environment_name environment.name end |
#record_undeployed ⇒ Object
110 111 112 113 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 110 def record_undeployed self.class.where(id: id).record_undeployed self.refresh end |
#version_number ⇒ Object
102 103 104 |
# File 'lib/pact_broker/deployments/deployed_version.rb', line 102 def version_number version.number end |