Skip to content

Commit ce168f9

Browse files
committed
re: RuboCop - use include_ prefix instead of has_
1 parent aa416b2 commit ce168f9

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,4 @@
99

1010

1111

12-
# Offense count: 3
13-
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
14-
# NamePrefix: is_, has_, have_
15-
# NamePrefixBlacklist: is_, has_, have_
16-
# NameWhitelist: is_a?
17-
Style/PredicateName:
18-
Exclude:
19-
- 'lib/active_model/serializer/associations.rb'
20-
- 'test/action_controller/json_api/linked_test.rb'
21-
2212

test/action_controller/json_api/linked_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,17 @@ def test_render_resource_with_nested_attributes_even_when_missing_associations
183183
get '/render_resource_with_missing_nested_has_many_include'
184184
response = JSON.parse(@response.body)
185185
assert response.key? 'included'
186-
refute has_type?(response['included'], 'roles')
186+
refute include_type?(response['included'], 'roles')
187187
end
188188

189189
def test_render_collection_with_missing_nested_has_many_include
190190
get '/render_collection_with_missing_nested_has_many_include'
191191
response = JSON.parse(@response.body)
192192
assert response.key? 'included'
193-
assert has_type?(response['included'], 'roles')
193+
assert include_type?(response['included'], 'roles')
194194
end
195195

196-
def has_type?(collection, value)
196+
def include_type?(collection, value)
197197
collection.detect { |i| i['type'] == value }
198198
end
199199
end

0 commit comments

Comments
 (0)