Permalink
Browse files

Not calling a private method anymore

  • Loading branch information...
1 parent e57197a commit 3916f0340e8714d36a64162be793192849a9e51f @wycats wycats committed Oct 7, 2009
Showing with 5 additions and 2 deletions.
  1. +5 −2 actionpack/lib/action_view/base.rb
@@ -237,8 +237,11 @@ def self.for_controller(controller)
if controller.class.respond_to?(:_helper_serial)
klass = @views[controller.class._helper_serial] ||= Class.new(self) do
name = controller.class.name.gsub(/::/, '__')
- Subclasses.remove_const(name) if Subclasses.const_defined?(name)
- Subclasses.const_set(name, self)
+
+ Subclasses.class_eval do
+ remove_const(name) if const_defined?(name)
+ const_set(name, self)
+ end
if controller.respond_to?(:_helpers)
include controller._helpers

2 comments on commit 3916f03

@ender672

Works fine for me in 1.8.6, but I get the following in 1.9.1:
http://gist.github.com/204326

This is after setting up a new rails project with:
$ rails test; cd test
$ script/generate scaffold static_page
$ script/server
=> Booting WEBrick
=> Rails 3.0.pre application starting on http://0.0.0.0:3000}
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2009-10-07 12:22:18] INFO WEBrick 1.3.1
[2009-10-07 12:22:18] INFO ruby 1.9.1 (2009-07-16) [x86_64-linux]
[2009-10-07 12:22:18] WARN TCPServer Error: Address already in use - bind(2)
[2009-10-07 12:22:18] INFO WEBrick::HTTPServer#start: pid=3524 port=3000

@ender672

Works fine for me in 1.8.6, but I get the following in 1.9.1:
http://gist.github.com/204326

This is after setting up a new rails project with:
$ rails test; cd test
$ script/generate scaffold static_page
$ script/server
=> Booting WEBrick
=> Rails 3.0.pre application starting on http://0.0.0.0:3000}
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2009-10-07 12:22:18] INFO WEBrick 1.3.1
[2009-10-07 12:22:18] INFO ruby 1.9.1 (2009-07-16) [x86_64-linux]
[2009-10-07 12:22:18] WARN TCPServer Error: Address already in use - bind(2)
[2009-10-07 12:22:18] INFO WEBrick::HTTPServer#start: pid=3524 port=3000

Please sign in to comment.