Skip to content

Commit 402a775

Browse files
authored
Rails 7.1
1 parent 2376421 commit 402a775

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/rails_console_commands/test_environment.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,12 @@ def disable_reloading
3434
end
3535

3636
def reload_classes
37-
if ActiveSupport::Dependencies.respond_to?(:mechanism=) # Rails < 7
38-
ActiveSupport::Dependencies.mechanism = :load
39-
end
40-
4137
Rails.application.reloader.reload!
4238
Rails.application.reloader.prepare!
4339
end
4440

4541
def reset_active_record
46-
return unless defined? ApplicationRecord
47-
ApplicationRecord.clear_active_connections!
48-
ApplicationRecord.establish_connection
42+
ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
4943
end
5044

5145
def add_test_dir_to_load_path

0 commit comments

Comments
 (0)