From 430a9574d263b890eddb5af7d176c7f3ba74e233 Mon Sep 17 00:00:00 2001 From: Pierre Schambacher Date: Wed, 23 Dec 2015 10:01:05 +0000 Subject: [PATCH] Remove deprecation warning for Rails 5.0 --- lib/database_cleaner/active_record/truncation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/database_cleaner/active_record/truncation.rb b/lib/database_cleaner/active_record/truncation.rb index 5ff75fb..82a6167 100644 --- a/lib/database_cleaner/active_record/truncation.rb +++ b/lib/database_cleaner/active_record/truncation.rb @@ -27,7 +27,7 @@ module DatabaseCleaner def database_cleaner_table_cache # the adapters don't do caching (#130) but we make the assumption that the list stays the same in tests - @database_cleaner_tables ||= tables + @database_cleaner_tables ||= ::ActiveRecord::VERSION::MAJOR >= 5 ? data_sources : tables end def truncate_table(table_name)