Module: ActiveSupport::Dependencies::ModuleConstMissing

Defined in:
lib/active_support/dependencies.rb

Overview

Module includes this module

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.excluded(base) ⇒ Object

:nodoc:



93
94
95
96
97
98
99
100
101
# File 'lib/active_support/dependencies.rb', line 93

def self.excluded(base) #:nodoc:
  base.class_eval do
    if defined? const_missing_without_dependencies
      undef_method :const_missing
      alias_method :const_missing, :const_missing_without_dependencies
      undef_method :const_missing_without_dependencies
    end
  end
end

.included(base) ⇒ Object

:nodoc:



85
86
87
88
89
90
91
# File 'lib/active_support/dependencies.rb', line 85

def self.included(base) #:nodoc:
  base.class_eval do
    unless defined? const_missing_without_dependencies
      alias_method_chain :const_missing, :dependencies
    end
  end
end

Instance Method Details

#const_missing_with_dependencies(class_id) ⇒ Object

Use const_missing to autoload associations so we don’t have to require_association when using single-table inheritance.



105
106
107
# File 'lib/active_support/dependencies.rb', line 105

def const_missing_with_dependencies(class_id)
  ActiveSupport::Dependencies.load_missing_constant self, class_id
end

#unloadable(const_desc = self) ⇒ Object



109
110
111
# File 'lib/active_support/dependencies.rb', line 109

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