Module: Reloadable

Defined in:
lib/active_support/reloadable.rb

Overview

A deprecated mechanism to mark a class reloadable.

Deprecated as of Rails 1.2. All autoloaded objects are now unloaded.

Defined Under Namespace

Modules: Deprecated, Subclasses

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

nodoc:

Raises:

  • (TypeError)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/active_support/reloadable.rb', line 10

def included(base) #nodoc:
  unless base.ancestors.include?(Reloadable::Subclasses) # Avoid double warning
    ActiveSupport::Deprecation.warn "Reloadable has been deprecated and has no effect.", caller
  end
  
  raise TypeError, "Only Classes can be Reloadable!" unless base.is_a? Class
  
  unless base.respond_to?(:reloadable?)
    class << base
      define_method(:reloadable?) do
        ActiveSupport::Deprecation.warn "Reloadable has been deprecated and reloadable? has no effect", caller
        true
      end
    end
  end
end

.reloadable_classesObject



27
28
29
30
31
# File 'lib/active_support/reloadable.rb', line 27

def reloadable_classes
  ActiveSupport::Deprecation.silence do
    included_in_classes.select { |klass| klass.reloadable? }
  end
end