Fix rubucop offenses

parent cd94c62a
......@@ -108,8 +108,8 @@ class GeoNode < ActiveRecord::Base
def validate(record)
# Prevent locking yourself out
if record.host == Gitlab.config.gitlab.host &&
record.port == Gitlab.config.gitlab.port &&
record.relative_url_root == Gitlab.config.gitlab.relative_url_root && !record.primary
record.port == Gitlab.config.gitlab.port &&
record.relative_url_root == Gitlab.config.gitlab.relative_url_root && !record.primary
record.errors[:base] << 'Current node must be the primary node or you will be locking yourself out'
end
end
......
......@@ -81,8 +81,8 @@ module MergeRequests
target_project = merge_request.target_project
if target_project.approvals_before_merge.nonzero? &&
target_project.reset_approvals_on_push &&
merge_request.rebase_commit_sha != @newrev
target_project.reset_approvals_on_push &&
merge_request.rebase_commit_sha != @newrev
merge_request.approvals.destroy_all
end
......
......@@ -24,7 +24,7 @@ module Elasticsearch
def es_configuration_changed?
@es_host != current_application_settings.elasticsearch_host ||
@es_port != current_application_settings.elasticsearch_port
@es_port != current_application_settings.elasticsearch_port
end
end
end
......
......@@ -55,7 +55,7 @@ module API
def log_user_activity(actor)
commands = Gitlab::GitAccess::DOWNLOAD_COMMANDS +
Gitlab::GitAccess::GIT_ANNEX_COMMANDS
Gitlab::GitAccess::GIT_ANNEX_COMMANDS
::Users::ActivityService.new(actor, 'Git SSH').execute if commands.include?(params[:action])
end
......
......@@ -90,8 +90,7 @@ module Gitlab
commit_validation = push_rule.try(:commit_validation?)
# if newrev is blank, the branch was deleted
return if Gitlab::Git.blank_ref?(@newrev) ||
!(commit_validation || validate_path_locks?)
return if Gitlab::Git.blank_ref?(@newrev) || !(commit_validation || validate_path_locks?)
commits.each do |commit|
next if commit_from_annex_sync?(commit.safe_message)
......
......@@ -49,8 +49,8 @@ module Gitlab
def self.oauth_authentication
return false unless Gitlab::Geo.secondary?
RequestStore.store[:geo_oauth_application] ||= Gitlab::Geo.current_node.oauth_application or
raise OauthApplicationUndefinedError
RequestStore.store[:geo_oauth_application] ||=
Gitlab::Geo.current_node.oauth_application or raise OauthApplicationUndefinedError
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment