diff options
Diffstat (limited to 'activesupport/lib/active_support/reloadable.rb')
-rw-r--r-- | activesupport/lib/active_support/reloadable.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/reloadable.rb b/activesupport/lib/active_support/reloadable.rb index fca397afeb..49e6442a37 100644 --- a/activesupport/lib/active_support/reloadable.rb +++ b/activesupport/lib/active_support/reloadable.rb @@ -1,4 +1,17 @@ # Classes that include this module will automatically be reloaded # by the Rails dispatcher when Dependencies.mechanism = :load. module Reloadable + class << self + def included(base) #nodoc: + if base.is_a?(Class) && ! base.respond_to?(:reloadable?) + class << base + define_method(:reloadable?) { true } + end + end + end + + def reloadable_classes + included_in_classes.select { |klass| klass.reloadable? } + end + end end
\ No newline at end of file |