module ActiveSupport::Dependencies::ModuleConstMissing

def self.append_features(base)

:nodoc:
Module includes this module.
def self.append_features(base)
  base.class_eval do
    # Emulate #exclude via an ivar
    return if defined?(@_const_missing) && @_const_missing
    @_const_missing = instance_method(:const_missing)
    remove_method(:const_missing)
  end
  super
end

def self.exclude_from(base)

def self.exclude_from(base)
  base.class_eval do
    define_method :const_missing, @_const_missing
    @_const_missing = nil
  end
end

def const_missing(const_name)

def const_missing(const_name)
  # The interpreter does not pass nesting information, and in the
  # case of anonymous modules we cannot even make the trade-off of
  # assuming their name reflects the nesting. Resort to Object as
  # the only meaningful guess we can make.
  from_mod = anonymous? ? ::Object : self
  Dependencies.load_missing_constant(from_mod, const_name)
end

def unloadable(const_desc = self)

def unloadable(const_desc = self)
  super(const_desc)
end