Commit 4867893431a00c47537c9f4657283db34a1d0be4

Authored by Laust Rud Jacobsen
1 parent 8b069d33
Exists in master and in 1 other branch production

Rubocop: fix more guarded methods

@@ -24,7 +24,7 @@ Style/IndentationConsistency: @@ -24,7 +24,7 @@ Style/IndentationConsistency:
24 EnforcedStyle: rails 24 EnforcedStyle: rails
25 25
26 Style/GuardClause: 26 Style/GuardClause:
27 - MinBodyLength: 10 27 + MinBodyLength: 6
28 28
29 Style/AccessModifierIndentation: 29 Style/AccessModifierIndentation:
30 EnforcedStyle: outdent 30 EnforcedStyle: outdent
app/controllers/deploys_controller.rb
@@ -19,15 +19,15 @@ class DeploysController < ApplicationController @@ -19,15 +19,15 @@ class DeploysController < ApplicationController
19 private 19 private
20 20
21 def default_deploy 21 def default_deploy
22 - if params[:deploy]  
23 - {  
24 - username: params[:deploy][:local_username],  
25 - environment: params[:deploy][:rails_env],  
26 - repository: params[:deploy][:scm_repository],  
27 - revision: params[:deploy][:scm_revision],  
28 - message: params[:deploy][:message]  
29 - }  
30 - end 22 + return if params[:deploy].blank?
  23 +
  24 + {
  25 + username: params[:deploy][:local_username],
  26 + environment: params[:deploy][:rails_env],
  27 + repository: params[:deploy][:scm_repository],
  28 + revision: params[:deploy][:scm_revision],
  29 + message: params[:deploy][:message]
  30 + }
31 end 31 end
32 32
33 # handle Heroku's HTTP post deployhook format 33 # handle Heroku's HTTP post deployhook format
app/helpers/apps_helper.rb
1 module AppsHelper 1 module AppsHelper
2 def link_to_copy_attributes_from_other_app 2 def link_to_copy_attributes_from_other_app
3 - if App.count > 1  
4 - html = link_to('copy settings from another app', '#',  
5 - class: 'button copy_config')  
6 - html << select("duplicate", "app",  
7 - App.all.asc(:name).reject { |a| a == @app }.  
8 - collect { |p| [p.name, p.id] }, { include_blank: "[choose app]" },  
9 - class: "choose_other_app", style: "display: none;")  
10 - return html  
11 - end 3 + return if App.count <= 1
  4 +
  5 + html = link_to('copy settings from another app', '#',
  6 + class: 'button copy_config')
  7 + html << select("duplicate", "app",
  8 + App.all.asc(:name).reject { |a| a == @app }.
  9 + collect { |p| [p.name, p.id] }, { include_blank: "[choose app]" },
  10 + class: "choose_other_app", style: "display: none;")
  11 + html
12 end 12 end
13 13
14 def any_github_repos? 14 def any_github_repos?