Skip to content

Commit

Permalink
Rails 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiculescu authored Sep 8, 2023
1 parent 2376421 commit 402a775
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/rails_console_commands/test_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,12 @@ def disable_reloading
end

def reload_classes
if ActiveSupport::Dependencies.respond_to?(:mechanism=) # Rails < 7
ActiveSupport::Dependencies.mechanism = :load
end

Rails.application.reloader.reload!
Rails.application.reloader.prepare!
end

def reset_active_record
return unless defined? ApplicationRecord
ApplicationRecord.clear_active_connections!
ApplicationRecord.establish_connection
ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
end

def add_test_dir_to_load_path
Expand Down

0 comments on commit 402a775

Please sign in to comment.