mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06: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
|
yield
|
||||||
end
|
end
|
||||||
elsif is_fragment_cached?
|
elsif is_fragment_cached?
|
||||||
FragmentCache.new(self, @cached_serializer, @options, @root).fetch
|
FragmentCache.new(self, @cached_serializer, @options).fetch
|
||||||
else
|
else
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,8 +5,7 @@ module ActiveModel
|
|||||||
|
|
||||||
attr_reader :serializer
|
attr_reader :serializer
|
||||||
|
|
||||||
def initialize(adapter, serializer, options, root)
|
def initialize(adapter, serializer, options)
|
||||||
@root = root
|
|
||||||
@options = options
|
@options = options
|
||||||
@adapter = adapter
|
@adapter = adapter
|
||||||
@serializer = serializer
|
@serializer = serializer
|
||||||
|
|||||||
@ -8,7 +8,7 @@ module ActiveModel
|
|||||||
@role = Role.new(name: 'Great Author', description:nil)
|
@role = Role.new(name: 'Great Author', description:nil)
|
||||||
@role.author = [@author]
|
@role.author = [@author]
|
||||||
@role_serializer = RoleSerializer.new(@role)
|
@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
|
end
|
||||||
|
|
||||||
def test_fragment_fetch_with_virtual_attributes
|
def test_fragment_fetch_with_virtual_attributes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user