Skip to content

Commit eccb359

Browse files
committed
Fix unnecessary nested serializers.
1 parent f4bb4c8 commit eccb359

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/adapter/json_api/linked_test.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,12 @@ class NoDuplicatesTest < Minitest::Test
289289

290290
class PostSerializer < ActiveModel::Serializer
291291
type 'posts'
292-
class AuthorSerializer < ActiveModel::Serializer
293-
type 'authors'
294-
has_many :posts, serializer: PostSerializer
295-
end
296-
belongs_to :author, serializer: AuthorSerializer
292+
belongs_to :author
293+
end
294+
295+
class AuthorSerializer < ActiveModel::Serializer
296+
type 'authors'
297+
has_many :posts
297298
end
298299

299300
def setup
@@ -313,7 +314,6 @@ def setup
313314

314315
def test_no_duplicates
315316
hash = ActiveModel::SerializableResource.new(@post1, adapter: :json_api,
316-
serializer: PostSerializer,
317317
include: '*.*')
318318
.serializable_hash
319319
expected = [
@@ -343,7 +343,6 @@ def test_no_duplicates
343343
def test_no_duplicates_collection
344344
hash = ActiveModel::SerializableResource.new(
345345
[@post1, @post2], adapter: :json_api,
346-
each_serializer: PostSerializer,
347346
include: '*.*')
348347
.serializable_hash
349348
expected = [

0 commit comments

Comments
 (0)