Commit 349949b1 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Rémy Coutable

Fix Style/SelfAssignment cop

parent 7184f293
......@@ -818,14 +818,6 @@ Style/RescueModifier:
Style/RescueStandardError:
Enabled: false
# Offense count: 4
# Cop supports --auto-correct.
Style/SelfAssignment:
Exclude:
- 'app/models/concerns/bulk_member_access_load.rb'
- 'app/serializers/base_serializer.rb'
- 'spec/support/import_export/configuration_helper.rb'
# Offense count: 50
# Cop supports --auto-correct.
# Configuration parameters: AllowIfMethodIsEmpty.
......
......@@ -22,7 +22,7 @@ module BulkMemberAccessLoad
end
# Look up only the IDs we need
resource_ids = resource_ids - access.keys
resource_ids -= access.keys
return access if resource_ids.empty?
......
......@@ -9,7 +9,7 @@ class BaseSerializer
end
def represent(resource, opts = {}, entity_class = nil)
entity_class = entity_class || self.class.entity_class
entity_class ||= self.class.entity_class
entity_class
.represent(resource, opts.merge(request: @request))
......
---
title: Fix Style/SelfAssignment cop
merge_request: 41079
author: Rajendra Kadam
type: fixed
......@@ -44,8 +44,8 @@ module ConfigurationHelper
import_export_config = config_hash(config)
excluded_attributes = import_export_config[:excluded_attributes][relation_name.to_sym]
included_attributes = import_export_config[:included_attributes][relation_name.to_sym]
attributes = attributes - Gitlab::Json.parse(excluded_attributes.to_json) if excluded_attributes
attributes = attributes & Gitlab::Json.parse(included_attributes.to_json) if included_attributes
attributes -= Gitlab::Json.parse(excluded_attributes.to_json) if excluded_attributes
attributes &= Gitlab::Json.parse(included_attributes.to_json) if included_attributes
attributes
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