Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
cc3b3ee99db4
Commit
6c354b86
authored
Jul 02, 2018
by
Lin Jen-Shin
Browse files
Updates from `rubocop -a`
parent
675ea958ba8c
Changes
188
Hide whitespace changes
Inline
Side-by-side
Rakefile
View file @
cc3b3ee9
...
...
@@ -2,9 +2,9 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require
File
.
expand_path
(
'
../
config/application'
,
__
FILE
__
)
require
File
.
expand_path
(
'config/application'
,
__
dir
__
)
relative_url_conf
=
File
.
expand_path
(
'
../
config/initializers/relative_url'
,
__
FILE
__
)
relative_url_conf
=
File
.
expand_path
(
'config/initializers/relative_url'
,
__
dir
__
)
require
relative_url_conf
if
File
.
exist?
(
"
#{
relative_url_conf
}
.rb"
)
Gitlab
::
Application
.
load_tasks
...
...
app/controllers/admin/deploy_keys_controller.rb
View file @
cc3b3ee9
...
...
@@ -22,7 +22,7 @@ def edit
end
def
update
if
deploy_key
.
update
_attributes
(
update_params
)
if
deploy_key
.
update
(
update_params
)
flash
[
:notice
]
=
'Deploy key was successfully updated.'
redirect_to
admin_deploy_keys_path
else
...
...
@@ -34,7 +34,7 @@ def destroy
deploy_key
.
destroy
respond_to
do
|
format
|
format
.
html
{
redirect_to
admin_deploy_keys_path
,
status:
302
}
format
.
html
{
redirect_to
admin_deploy_keys_path
,
status:
:found
}
format
.
json
{
head
:ok
}
end
end
...
...
app/controllers/admin/groups_controller.rb
View file @
cc3b3ee9
...
...
@@ -39,7 +39,7 @@ def create
end
def
update
if
@group
.
update
_attributes
(
group_params
)
if
@group
.
update
(
group_params
)
redirect_to
[
:admin
,
@group
],
notice:
'Group was successfully updated.'
else
render
"edit"
...
...
app/controllers/admin/hooks_controller.rb
View file @
cc3b3ee9
...
...
@@ -23,7 +23,7 @@ def edit
end
def
update
if
hook
.
update
_attributes
(
hook_params
)
if
hook
.
update
(
hook_params
)
flash
[
:notice
]
=
'System hook was successfully updated.'
redirect_to
admin_hooks_path
else
...
...
@@ -34,7 +34,7 @@ def update
def
destroy
hook
.
destroy
redirect_to
admin_hooks_path
,
status:
302
redirect_to
admin_hooks_path
,
status:
:found
end
def
test
...
...
app/controllers/admin/identities_controller.rb
View file @
cc3b3ee9
...
...
@@ -25,7 +25,7 @@ def edit
end
def
update
if
@identity
.
update
_attributes
(
identity_params
)
if
@identity
.
update
(
identity_params
)
RepairLdapBlockedUserService
.
new
(
@user
).
execute
redirect_to
admin_user_identities_path
(
@user
),
notice:
'User identity was successfully updated.'
else
...
...
app/controllers/admin/impersonations_controller.rb
View file @
cc3b3ee9
...
...
@@ -11,7 +11,7 @@ def destroy
session
[
:impersonator_id
]
=
nil
redirect_to
admin_user_path
(
original_user
),
status:
302
redirect_to
admin_user_path
(
original_user
),
status:
:found
end
private
...
...
app/controllers/admin/jobs_controller.rb
View file @
cc3b3ee9
...
...
@@ -20,6 +20,6 @@ def index
def
cancel_all
Ci
::
Build
.
running_or_pending
.
each
(
&
:cancel
)
redirect_to
admin_jobs_path
,
status:
303
redirect_to
admin_jobs_path
,
status:
:see_other
end
end
app/controllers/admin/runner_projects_controller.rb
View file @
cc3b3ee9
...
...
@@ -16,7 +16,7 @@ def destroy
runner
=
rp
.
runner
rp
.
destroy
redirect_to
admin_runner_path
(
runner
),
status:
302
redirect_to
admin_runner_path
(
runner
),
status:
:found
end
private
...
...
app/controllers/admin/runners_controller.rb
View file @
cc3b3ee9
...
...
@@ -28,7 +28,7 @@ def update
def
destroy
@runner
.
destroy
redirect_to
admin_runners_path
,
status:
302
redirect_to
admin_runners_path
,
status:
:found
end
def
resume
...
...
app/controllers/admin/services_controller.rb
View file @
cc3b3ee9
...
...
@@ -16,7 +16,7 @@ def edit
end
def
update
if
service
.
update
_attributes
(
service_params
[
:service
])
if
service
.
update
(
service_params
[
:service
])
PropagateServiceTemplateWorker
.
perform_async
(
service
.
id
)
if
service
.
active?
redirect_to
admin_application_settings_services_path
,
...
...
app/controllers/admin/users_controller.rb
View file @
cc3b3ee9
...
...
@@ -163,7 +163,7 @@ def remove_email
format
.
json
{
head
:ok
}
else
format
.
html
{
redirect_back_or_admin_user
(
alert:
'There was an error removing the e-mail.'
)
}
format
.
json
{
render
json:
'There was an error removing the e-mail.'
,
status:
400
}
format
.
json
{
render
json:
'There was an error removing the e-mail.'
,
status:
:bad_request
}
end
end
end
...
...
app/controllers/concerns/issuable_actions.rb
View file @
cc3b3ee9
...
...
@@ -127,7 +127,7 @@ def render_conflict_response
errors:
[
"Someone edited this
#{
issuable
.
human_class_name
}
at the same time you did. Please refresh your browser and make sure your changes will not unintentionally remove theirs."
]
},
status:
409
},
status:
:conflict
end
end
end
...
...
app/controllers/concerns/lfs_request.rb
View file @
cc3b3ee9
...
...
@@ -27,7 +27,7 @@ def require_lfs_enabled!
message:
'Git LFS is not enabled on this GitLab server, contact your admin.'
,
documentation_url:
help_url
},
status:
501
status:
:not_implemented
)
end
...
...
app/controllers/groups/avatars_controller.rb
View file @
cc3b3ee9
...
...
@@ -7,6 +7,6 @@ def destroy
@group
.
remove_avatar!
@group
.
save
redirect_to
edit_group_path
(
@group
),
status:
302
redirect_to
edit_group_path
(
@group
),
status:
:found
end
end
app/controllers/groups/runners_controller.rb
View file @
cc3b3ee9
...
...
@@ -23,7 +23,7 @@ def update
def
destroy
@runner
.
destroy
redirect_to
group_settings_ci_cd_path
(
@group
,
anchor:
'runners-settings'
),
status:
302
redirect_to
group_settings_ci_cd_path
(
@group
,
anchor:
'runners-settings'
),
status:
:found
end
def
resume
...
...
app/controllers/jwt_controller.rb
View file @
cc3b3ee9
...
...
@@ -41,7 +41,7 @@ def render_missing_personal_access_token
"You must use a personal access token with 'api' scope for Git over HTTP.
\n
"
\
"You can generate one at
#{
profile_personal_access_tokens_url
}
"
}
]
},
status:
401
},
status:
:unauthorized
end
def
render_unauthorized
...
...
@@ -50,7 +50,7 @@ def render_unauthorized
{
code:
'UNAUTHORIZED'
,
message:
'HTTP Basic: Access denied'
}
]
},
status:
401
},
status:
:unauthorized
end
def
auth_params
...
...
app/controllers/notification_settings_controller.rb
View file @
cc3b3ee9
...
...
@@ -5,14 +5,14 @@ def create
return
render_404
unless
can_read?
(
resource
)
@notification_setting
=
current_user
.
notification_settings_for
(
resource
)
@saved
=
@notification_setting
.
update
_attributes
(
notification_setting_params
)
@saved
=
@notification_setting
.
update
(
notification_setting_params
)
render_response
end
def
update
@notification_setting
=
current_user
.
notification_settings
.
find
(
params
[
:id
])
@saved
=
@notification_setting
.
update
_attributes
(
notification_setting_params
)
@saved
=
@notification_setting
.
update
(
notification_setting_params
)
render_response
end
...
...
app/controllers/profiles/active_sessions_controller.rb
View file @
cc3b3ee9
...
...
@@ -7,7 +7,7 @@ def destroy
ActiveSession
.
destroy
(
current_user
,
params
[
:id
])
respond_to
do
|
format
|
format
.
html
{
redirect_to
profile_active_sessions_url
,
status:
302
}
format
.
html
{
redirect_to
profile_active_sessions_url
,
status:
:found
}
format
.
js
{
head
:ok
}
end
end
...
...
app/controllers/profiles/avatars_controller.rb
View file @
cc3b3ee9
...
...
@@ -4,6 +4,6 @@ def destroy
Users
::
UpdateService
.
new
(
current_user
,
user:
@user
).
execute
{
|
user
|
user
.
remove_avatar!
}
redirect_to
profile_path
,
status:
302
redirect_to
profile_path
,
status:
:found
end
end
app/controllers/profiles/chat_names_controller.rb
View file @
cc3b3ee9
...
...
@@ -39,7 +39,7 @@ def destroy
flash
[
:alert
]
=
"Could not delete chat nickname
#{
@chat_name
.
chat_name
}
."
end
redirect_to
profile_chat_names_path
,
status:
302
redirect_to
profile_chat_names_path
,
status:
:found
end
private
...
...
Prev
1
2
3
4
5
…
10
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment