diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-10-08 15:05:18 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-10-08 15:05:18 -0300 |
commit | 0cf4662ec589813c4fdc22de3398730cab05c5ed (patch) | |
tree | d422b8d8e4ccccf9bd89443b82398e1d7313269f /actionpack/lib/action_view/base.rb | |
parent | c3f9d51a00b9e7e5f5d14e7464fae04c48198756 (diff) | |
parent | 665c7ad29d5614b8f5535d317f1dd2803ddcaa7d (diff) | |
download | rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.tar.gz rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.tar.bz2 rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.zip |
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 664cc3b562..82b419d846 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -239,7 +239,11 @@ module ActionView #:nodoc: name = controller.class.name.gsub(/::/, '__') Subclasses.class_eval do - remove_const(name) if const_defined?(name) + if method(:const_defined?).arity == 1 + remove_const(name) if const_defined?(name) # Ruby 1.8.x + else + remove_const(name) if const_defined?(name, false) # Ruby 1.9.x + end const_set(name, self) end @@ -260,7 +264,7 @@ module ActionView #:nodoc: @assigns = assigns_for_first_render.each { |key, value| instance_variable_set("@#{key}", value) } @controller = controller @helpers = self.class.helpers || Module.new - @_content_for = Hash.new {|h,k| h[k] = "" } + @_content_for = Hash.new {|h,k| h[k] = ActionView::SafeBuffer.new } self.view_paths = view_paths end |