summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-21 17:50:22 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:31:57 -0600
commit030baf70d25a666b660b0024f000586631ee3daf (patch)
tree20dbdbb674e9a4fd0ad6d82161e34fd26aaf37cd /app
parentc5a49cc3c56283ae5f015c808327b1a29ca09ed9 (diff)
downloadgitlab-ce-030baf70d25a666b660b0024f000586631ee3daf.tar.gz
Enable Performance/RedundantMerge
Diffstat (limited to 'app')
-rw-r--r--app/helpers/sorting_helper.rb2
-rw-r--r--app/models/concerns/issuable.rb2
-rw-r--r--app/models/merge_request.rb2
-rw-r--r--app/models/project_services/pushover_service.rb2
-rw-r--r--app/services/protected_branches/api_update_service.rb8
-rw-r--r--app/services/system_hooks_service.rb4
-rw-r--r--app/services/system_note_service.rb2
7 files changed, 10 insertions, 12 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb
index ff787fb4131..8ad3851fb9a 100644
--- a/app/helpers/sorting_helper.rb
+++ b/app/helpers/sorting_helper.rb
@@ -30,7 +30,7 @@ module SortingHelper
}
if current_controller?('admin/projects')
- options.merge!(sort_value_largest_repo => sort_title_largest_repo)
+ options[sort_value_largest_repo] = sort_title_largest_repo
end
options
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index e07ae9d1660..768baa80c01 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -235,7 +235,7 @@ module Issuable
# DEPRECATED
repository: project.hook_attrs.slice(:name, :url, :description, :homepage)
}
- hook_data.merge!(assignee: assignee.hook_attrs) if assignee
+ hook_data[:assignee] = assignee.hook_attrs if assignee
hook_data
end
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index a0b8a63d6ab..ea784f77015 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -527,7 +527,7 @@ class MergeRequest < ActiveRecord::Base
}
if diff_head_commit
- attrs.merge!(last_commit: diff_head_commit.hook_attrs)
+ attrs[:last_commit] = diff_head_commit.hook_attrs
end
attributes.merge!(attrs)
diff --git a/app/models/project_services/pushover_service.rb b/app/models/project_services/pushover_service.rb
index a963d27a376..f623bf9851b 100644
--- a/app/models/project_services/pushover_service.rb
+++ b/app/models/project_services/pushover_service.rb
@@ -97,7 +97,7 @@ class PushoverService < Service
# Sound parameter MUST NOT be sent to API if not selected
if sound
- pushover_data.merge!(sound: sound)
+ pushover_data[:sound] = sound
end
PushoverService.post('/messages.json', body: pushover_data)
diff --git a/app/services/protected_branches/api_update_service.rb b/app/services/protected_branches/api_update_service.rb
index 050cb3b738b..bdb0e0cc8bf 100644
--- a/app/services/protected_branches/api_update_service.rb
+++ b/app/services/protected_branches/api_update_service.rb
@@ -15,16 +15,16 @@ module ProtectedBranches
case @developers_can_push
when true
- params.merge!(push_access_levels_attributes: [{ access_level: Gitlab::Access::DEVELOPER }])
+ params[:push_access_levels_attributes] = [{ access_level: Gitlab::Access::DEVELOPER }]
when false
- params.merge!(push_access_levels_attributes: [{ access_level: Gitlab::Access::MASTER }])
+ params[:push_access_levels_attributes] = [{ access_level: Gitlab::Access::MASTER }]
end
case @developers_can_merge
when true
- params.merge!(merge_access_levels_attributes: [{ access_level: Gitlab::Access::DEVELOPER }])
+ params[:merge_access_levels_attributes] = [{ access_level: Gitlab::Access::DEVELOPER }]
when false
- params.merge!(merge_access_levels_attributes: [{ access_level: Gitlab::Access::MASTER }])
+ params[:merge_access_levels_attributes] = [{ access_level: Gitlab::Access::MASTER }]
end
service = ProtectedBranches::UpdateService.new(@project, @current_user, @params)
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb
index a2bfa422c9d..9b6dd013e3a 100644
--- a/app/services/system_hooks_service.rb
+++ b/app/services/system_hooks_service.rb
@@ -33,9 +33,7 @@ class SystemHooksService
data.merge!(project_data(model))
if event == :rename || event == :transfer
- data.merge!({
- old_path_with_namespace: model.old_path_with_namespace
- })
+ data[:old_path_with_namespace] = model.old_path_with_namespace
end
data
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 87ba72cf991..71b4f8605a4 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -359,7 +359,7 @@ module SystemNoteService
if noteable.kind_of?(Commit)
note_options.merge!(noteable_type: 'Commit', commit_id: noteable.id)
else
- note_options.merge!(noteable: noteable)
+ note_options[:noteable] = noteable
end
if noteable.is_a?(ExternalIssue)