Method: ActiveSupport::Dependencies#remove_unloadable_constants!

Defined in:
activesupport/lib/active_support/dependencies.rb

#remove_unloadable_constants!Object

Remove the constants that have been autoloaded, and those that have been marked for unloading. Before each constant is removed a callback is sent to its class/module if it implements before_remove_const.

The callback implementation should be restricted to cleaning up caches, etc. as the environment will be in an inconsistent state, e.g. other constants may have already been unloaded and not accessible.


532
533
534
535
536
537
# File 'activesupport/lib/active_support/dependencies.rb', line 532

def remove_unloadable_constants!
  autoloaded_constants.each { |const| remove_constant const }
  autoloaded_constants.clear
  Reference.clear!
  explicitly_unloadable_constants.each { |const| remove_constant const }
end