aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/abstract_controller/base.rb')
-rw-r--r--actionpack/lib/abstract_controller/base.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index 388e043f0b..56dc9ab7a1 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -34,6 +34,15 @@ module AbstractController
@abstract = true
end
+ def inherited(klass) # :nodoc:
+ # define the abstract ivar on subclasses so that we don't get
+ # uninitialized ivar warnings
+ unless klass.instance_variable_defined?(:@abstract)
+ klass.instance_variable_set(:@abstract, false)
+ end
+ super
+ end
+
# A list of all internal methods for a controller. This finds the first
# abstract superclass of a controller, and gets a list of all public
# instance methods on that abstract class. Public instance methods of
@@ -42,6 +51,7 @@ module AbstractController
# (ActionController::Metal and ActionController::Base are defined as abstract)
def internal_methods
controller = self
+
controller = controller.superclass until controller.abstract?
controller.public_instance_methods(true)
end