File: migrations.rb

package info (click to toggle)
ruby-factory-bot-rails 6.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 380 kB
  • sloc: ruby: 645; makefile: 6; sh: 4
file content (27 lines) | stat: -rw-r--r-- 583 bytes parent folder | download
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