Class: Bosh::Director::Models::Deployment
- Defined in:
- lib/bosh/director/models/deployment.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create_with_teams(attributes) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/bosh/director/models/deployment.rb', line 28 def self.create_with_teams(attributes) teams = attributes.delete(:teams) deployment = create(attributes) deployment.teams = teams deployment end |
Instance Method Details
#link_spec ⇒ Object
19 20 21 22 |
# File 'lib/bosh/director/models/deployment.rb', line 19 def link_spec result = self.link_spec_json result ? JSON.parse(result) : {} end |
#link_spec=(data) ⇒ Object
24 25 26 |
# File 'lib/bosh/director/models/deployment.rb', line 24 def link_spec=(data) self.link_spec_json = JSON.generate(data) end |
#teams=(teams) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/bosh/director/models/deployment.rb', line 35 def teams=(teams) Bosh::Director::Transactor.new.retryable_transaction(Deployment.db) do self.remove_all_teams (teams || []).each do |t| self.add_team(t) end end end |