From 681d89f96bc1784edecf74992177a48be07e2b99 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 2 Mar 2012 10:54:16 -0300 Subject: Stop SafeBuffer#clone_empty from issuing warnings Logic in clone_empty method was dealing with old @dirty variable, which has changed by @html_safe in this commit: https://github.com/rails/rails/commit/139963c99a955520db6373343662e55f4d16dcd1 This was issuing a "not initialized variable" warning - related to: https://github.com/rails/rails/pull/5237 The logic applied by this method is already handled by the [] override, so there is no need to reset the variable here. --- activesupport/lib/active_support/core_ext/string/output_safety.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 728ab087fa..4903687b73 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -131,9 +131,7 @@ module ActiveSupport #:nodoc: end def clone_empty - new_safe_buffer = self[0, 0] - new_safe_buffer.instance_variable_set(:@dirty, @dirty) - new_safe_buffer + self[0, 0] end def concat(value) -- cgit v1.2.3