Skip to content

Commit cd38ec0

Browse files
author
James McCarthy
committed
Fix the Ruboop errors.
1 parent 958e23c commit cd38ec0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/grape_entity/exposure/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def nesting?
4444
end
4545

4646
# if we have any nesting exposures with the same name.
47-
def deep_complex_nesting?(entity)
47+
def deep_complex_nesting?(entity) # rubocop:disable Lint/UnusedMethodArgument
4848
false
4949
end
5050

@@ -105,7 +105,7 @@ def attr_path(entity, options)
105105
end
106106
end
107107

108-
def key(entity=nil)
108+
def key(entity = nil)
109109
@key.respond_to?(:call) ? @key.call(entity).try(:to_sym) : @key
110110
end
111111

lib/grape_entity/exposure/nesting_exposure.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def normalized_exposures(entity, options)
113113
end
114114
new_nested_exposures = nesting_tail.flat_map(&:nested_exposures)
115115
NestingExposure.new(key, {}, [], new_nested_exposures).tap do |new_exposure|
116-
new_exposure.instance_variable_set(:@deep_complex_nesting, true) if nesting_tail.any? { |exposure| exposure.deep_complex_nesting?(entity) }
116+
if nesting_tail.any? { |exposure| exposure.deep_complex_nesting?(entity) }
117+
new_exposure.instance_variable_set(:@deep_complex_nesting, true)
118+
end
117119
end
118120
else
119121
last_exposure

lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def deep_complex_nesting?(entity)
5858
all_nesting = select(&:nesting?)
5959
@deep_complex_nesting =
6060
all_nesting
61-
.group_by { |exposure| exposure.key(entity) }
62-
.any? { |_key, exposures| exposures.length > 1 }
61+
.group_by { |exposure| exposure.key(entity) }
62+
.any? { |_key, exposures| exposures.length > 1 }
6363
else
6464
@deep_complex_nesting
6565
end

0 commit comments

Comments
 (0)