diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/reloadable.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/reloadable.rb b/activesupport/lib/active_support/reloadable.rb index 7749f0b165..179e04a0fe 100644 --- a/activesupport/lib/active_support/reloadable.rb +++ b/activesupport/lib/active_support/reloadable.rb @@ -15,13 +15,13 @@ module Reloadable end end + # Captures the common pattern where a base class should not be reloaded, + # but its subclasses should be. module OnlySubclasses - class << self - def included(base) #nodoc: - base.send :include, Reloadable - (class << base; self; end;).class_eval do - define_method(:reloadable?) { self != base } - end + def self.included(base) #nodoc: + base.send :include, Reloadable + (class << base; self; end).send(:define_method, :reloadable?) do + base != self end end end |