mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Fix RuboCop 0.40 linter errors (#1722)
These errors are breaking the build, which seems to use RuboCop 0.40 [1] despite the Gemfile.lock pinning rubocop to 0.38. New lints that I am updating the code style to reflect: - Style/EmptyCaseCondition: Do not use empty case condition, instead use an if expression. - Style/MultilineArrayBraceLayout: Closing array brace must be on the same line as the last array element when opening brace is on the same line as the first array element. - Style/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element. - Style/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument. [1] https://github.com/bbatsov/rubocop/releases/tag/v0.40.0
This commit is contained in:
committed by
L. Preston Sego III
parent
8a3196d920
commit
94db09b3f6
@@ -341,9 +341,10 @@ module ActiveModelSerializers
|
||||
|
||||
def test_no_duplicates_collection
|
||||
hash = ActiveModelSerializers::SerializableResource.new(
|
||||
[@post1, @post2], adapter: :json_api,
|
||||
include: '*.*')
|
||||
.serializable_hash
|
||||
[@post1, @post2],
|
||||
adapter: :json_api,
|
||||
include: '*.*'
|
||||
).serializable_hash
|
||||
expected = [
|
||||
{
|
||||
type: 'authors', id: '1',
|
||||
@@ -364,7 +365,8 @@ module ActiveModelSerializers
|
||||
hash = ActiveModelSerializers::SerializableResource.new(
|
||||
@nestedpost1,
|
||||
adapter: :json_api,
|
||||
include: '*').serializable_hash
|
||||
include: '*'
|
||||
).serializable_hash
|
||||
expected = [
|
||||
type: 'nested-posts', id: '2',
|
||||
relationships: {
|
||||
@@ -383,7 +385,8 @@ module ActiveModelSerializers
|
||||
hash = ActiveModelSerializers::SerializableResource.new(
|
||||
[@nestedpost1, @nestedpost2],
|
||||
adapter: :json_api,
|
||||
include: '*').serializable_hash
|
||||
include: '*'
|
||||
).serializable_hash
|
||||
assert_nil(hash[:included])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user