mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
removing unnecessary root parameter on fragment cache
This commit is contained in:
parent
7fa123bd6b
commit
37114e9d5b
@ -48,7 +48,7 @@ module ActiveModel
|
||||
yield
|
||||
end
|
||||
elsif is_fragment_cached?
|
||||
FragmentCache.new(self, @cached_serializer, @options, @root).fetch
|
||||
FragmentCache.new(self, @cached_serializer, @options).fetch
|
||||
else
|
||||
yield
|
||||
end
|
||||
|
||||
@ -5,8 +5,7 @@ module ActiveModel
|
||||
|
||||
attr_reader :serializer
|
||||
|
||||
def initialize(adapter, serializer, options, root)
|
||||
@root = root
|
||||
def initialize(adapter, serializer, options)
|
||||
@options = options
|
||||
@adapter = adapter
|
||||
@serializer = serializer
|
||||
|
||||
@ -8,7 +8,7 @@ module ActiveModel
|
||||
@role = Role.new(name: 'Great Author', description:nil)
|
||||
@role.author = [@author]
|
||||
@role_serializer = RoleSerializer.new(@role)
|
||||
@role_hash = FragmentCache.new(RoleSerializer.adapter.new(@role_serializer), @role_serializer, {}, nil)
|
||||
@role_hash = FragmentCache.new(RoleSerializer.adapter.new(@role_serializer), @role_serializer, {})
|
||||
end
|
||||
|
||||
def test_fragment_fetch_with_virtual_attributes
|
||||
|
||||
Loading…
Reference in New Issue
Block a user