Commit 4867893431a00c47537c9f4657283db34a1d0be4
1 parent
8b069d33
Exists in
master
and in
1 other branch
Rubocop: fix more guarded methods
Showing
3 changed files
with
19 additions
and
19 deletions
Show diff stats
.rubocop.yml
app/controllers/deploys_controller.rb
... | ... | @@ -19,15 +19,15 @@ class DeploysController < ApplicationController |
19 | 19 | private |
20 | 20 | |
21 | 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 | 31 | end |
32 | 32 | |
33 | 33 | # handle Heroku's HTTP post deployhook format | ... | ... |
app/helpers/apps_helper.rb
1 | 1 | module AppsHelper |
2 | 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 | 12 | end |
13 | 13 | |
14 | 14 | def any_github_repos? | ... | ... |