Skip to content

Commit 6b6c982

Browse files
committed
introduce database cleaner monkeypatch
1 parent b4bed49 commit 6b6c982

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,4 @@ def sqlite?
100100
require_relative 'support/helpers'
101101
require_relative 'support/exceed_query_limit'
102102
require_relative 'support/query_counter'
103+
require_relative 'support/database_cleaner_monkeypatch'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module DatabaseCleaner
2+
module ActiveRecord
3+
class Base < DatabaseCleaner::Strategy
4+
def self.migration_table_name
5+
if Gem::Version.new("6.0.0") <= ::ActiveRecord.version
6+
::ActiveRecord::Base.connection.schema_migration.table_name
7+
else
8+
::ActiveRecord::SchemaMigration.table_name
9+
end
10+
end
11+
end
12+
end
13+
end

0 commit comments

Comments
 (0)