From 0c5e31ea7359122e01599f77bae51dda687fef46 Mon Sep 17 00:00:00 2001 From: Kristaps Kulikovskis Date: Wed, 27 Sep 2017 14:50:28 +0300 Subject: [PATCH] remove version checking --- lib/database_flusher/active_record/deletion_strategy.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/database_flusher/active_record/deletion_strategy.rb b/lib/database_flusher/active_record/deletion_strategy.rb index 5e2e467..cb78b4f 100644 --- a/lib/database_flusher/active_record/deletion_strategy.rb +++ b/lib/database_flusher/active_record/deletion_strategy.rb @@ -86,10 +86,8 @@ def adapter def all_tables # NOTE connection.tables warns on AR 5 with some adapters tables = ActiveSupport::Deprecation.silence { connection.tables } - migrations_table = defined?(::Rails) && ::Rails::VERSION::MAJOR >= 4 ? ::ActiveRecord::SchemaMigration.table_name : ::ActiveRecord::Migrator.schema_migrations_table_name - tables.reject do |t| - (t == migrations_table) || + (t == ::ActiveRecord::SchemaMigration.table_name) || (::ActiveRecord::Base.respond_to?(:internal_metadata_table_name) && (t == ::ActiveRecord::Base.internal_metadata_table_name)) end