removing unnecessary root parameter on fragment cache

This commit is contained in:
João Moura 2015-06-13 14:54:51 -03:00
parent 7fa123bd6b
commit 37114e9d5b
3 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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