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:



67
68
69
70
71
72
73
74
75
# File 'lib/active_support/dependencies.rb', line 67

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:



59
60
61
62
63
64
65
# File 'lib/active_support/dependencies.rb', line 59

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.



79
80
81
# File 'lib/active_support/dependencies.rb', line 79

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

#unloadable(const_desc = self) ⇒ Object



83
84
85
# File 'lib/active_support/dependencies.rb', line 83

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