1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
# frozen_string_literal: true
ActiveStorage::Engine.root.glob("db/migrate/*.rb").each { |file| require file }
ActiveSupport.on_load :active_support_test_case do
setup do
CreateActiveStorageTables.migrate :up
end
teardown do
CreateActiveStorageTables.migrate :down
rescue ActiveRecord::StatementInvalid
# no-op
end
end
defined?(RSpec) && RSpec.configure do |config|
config.before do
CreateActiveStorageTables.migrate :up
end
config.after do
CreateActiveStorageTables.migrate :down
rescue ActiveRecord::StatementInvalid
# no-op
end
end
|