Skip to content

Commit 70604bb

Browse files
committed
Only set cache_versioning to true on rails versions when relevant
1 parent 7f751fc commit 70604bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/cache_test.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ class InheritedRoleSerializer < RoleSerializer
151151
@blog_serializer = BlogSerializer.new(@blog)
152152
end
153153

154-
def test_expire_of_cache
155-
ARModels::Author.cache_versioning = true
154+
def test_expiring_of_cache_at_update_of_record
155+
if ARModels::Author.respond_to?(:cache_versioning)
156+
ARModels::Author.cache_versioning = true
157+
end
158+
156159
author = ARModels::Author.create(name: 'Foo')
157160
author_json = AuthorSerializerWithCache.new(author).as_json
158161

0 commit comments

Comments
 (0)