diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-17 16:13:19 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-17 16:13:19 +0200 |
commit | 9b790f1cf97157240178601c62d2e557a404503e (patch) | |
tree | 5013faeb348f3b68c5066742bac575026d6e74a7 /app/services | |
parent | 50d3cc2b677dac855a6270f5ffed7085df8edcf8 (diff) | |
download | gitlab-ce-9b790f1cf97157240178601c62d2e557a404503e.tar.gz |
Improve after code review
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/create_deployment_service.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/create_deployment_service.rb b/app/services/create_deployment_service.rb index 5e6745cdd4e..85c0bf72074 100644 --- a/app/services/create_deployment_service.rb +++ b/app/services/create_deployment_service.rb @@ -6,10 +6,11 @@ class CreateDeploymentService < BaseService ActiveRecord::Base.transaction do @deployable = deployable + @environment = environment @environment.external_url = expanded_url if expanded_url @environment.state_event = action - @environment.save + @environment.save! return if @environment.stopped? @@ -33,7 +34,7 @@ class CreateDeploymentService < BaseService sha: params[:sha], user: current_user, deployable: @deployable, - on_stop: options.fetch(:on_stop, nil)) + on_stop: options[:on_stop]) end def environment |