Skip to content

Commit

Permalink
Run doctest helper initializer after connection
Browse files Browse the repository at this point in the history
Without this, ActiveRecord does not yet know which type of adapter to
use. This makes monkey patching the specific adapter class(es) that you
need impossible.

This mirrors what we do in the spec helper.
  • Loading branch information
michaelherold committed Oct 21, 2023
1 parent 9b6d720 commit fcad5d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord-ksuid/spec/doctest_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

require 'active_record/ksuid/railtie'

ActiveRecord::KSUID::Railtie.initializers.each(&:run)
ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(IO::NULL)
ActiveRecord::Schema.verbose = false

ActiveRecord::KSUID::Railtie.initializers.each(&:run)
ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)

ActiveSupport::Deprecation.instance.silenced = true

0 comments on commit fcad5d1

Please sign in to comment.