aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/reloadable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/reloadable.rb')
-rw-r--r--activesupport/lib/active_support/reloadable.rb12
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