Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix uninitialized ivar warnings
  • Loading branch information
tenderlove committed Oct 25, 2012
1 parent f5ae64d commit 6033e8a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions actionpack/lib/abstract_controller/base.rb
Expand Up @@ -34,6 +34,15 @@ def abstract!
@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
Expand All @@ -42,6 +51,7 @@ def abstract!
# (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
Expand Down

0 comments on commit 6033e8a

Please sign in to comment.