Remove unnecessary Adapter::Base#cache_attributes

This commit is contained in:
Benjamin Fleischer
2016-04-14 21:47:30 -05:00
parent b8af2892f7
commit ee518e1856
2 changed files with 6 additions and 12 deletions

View File

@@ -303,8 +303,8 @@ module ActiveModelSerializers
render_object_with_cache(@comment)
attributes = Adapter::Attributes.new(serializer)
attributes.send(:cache_attributes)
cached_attributes = attributes.instance_variable_get(:@cached_attributes)
include_directive = ActiveModelSerializers.default_include_directive
cached_attributes = ActiveModel::Serializer.cache_read_multi(serializer, attributes, include_directive)
assert_equal cached_attributes["#{@comment.cache_key}/#{attributes.cached_name}"], Comment.new(id: 1, body: 'ZOMG A COMMENT').attributes
assert_equal cached_attributes["#{@comment.post.cache_key}/#{attributes.cached_name}"], Post.new(id: 'post', title: 'New Post', body: 'Body').attributes