From dafb4bd33ba26bf8ca3455db270fee843c8bd2fd Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Wed, 22 Sep 2010 16:53:02 -0300 Subject: Don't shadow outer local variables. --- actionpack/lib/action_view/testing/resolvers.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/testing/resolvers.rb b/actionpack/lib/action_view/testing/resolvers.rb index 97de2471cf..b2b62528a9 100644 --- a/actionpack/lib/action_view/testing/resolvers.rb +++ b/actionpack/lib/action_view/testing/resolvers.rb @@ -22,10 +22,10 @@ module ActionView #:nodoc: end templates = [] - @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source| - handler, format = extract_handler_and_format(path, formats) - templates << Template.new(source, path, handler, - :virtual_path => path, :format => format) + @hash.select { |k,v| k =~ /^#{query}$/ }.each do |_path, source| + handler, format = extract_handler_and_format(_path, formats) + templates << Template.new(source, _path, handler, + :virtual_path => _path, :format => format) end templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } -- cgit v1.2.3 From 74d7664b607a7ca2770c937a832b3339d7bf8203 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Fri, 24 Sep 2010 16:07:17 -0300 Subject: Avoid uninitialized variable warning. --- actionpack/lib/action_view/helpers/date_helper.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 9891478606..3aee4fb773 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -923,6 +923,7 @@ module ActionView private def datetime_selector(options, html_options) datetime = value(object) || default_datetime(options) + @auto_index ||= nil options = options.dup options[:field_name] = @method_name -- cgit v1.2.3 From e7c833fca9c18807245bf1a75cbb212a626e278c Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Fri, 24 Sep 2010 16:07:37 -0300 Subject: Define @emitted_hidden_id if it doesn't exists and reuse it if it does. --- actionpack/lib/action_view/helpers/form_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 3ebc6601e5..8bae6d2796 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -1237,7 +1237,7 @@ module ActionView end def emitted_hidden_id? - @emitted_hidden_id + @emitted_hidden_id ||= nil end private -- cgit v1.2.3 From 2f59cd6fd6c54bd55d4cd55f59cae413e961626a Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Fri, 24 Sep 2010 16:08:04 -0300 Subject: Remove method previous method if already defined. --- actionpack/lib/action_view/test_case.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index ff35fb7df4..32fd8c5e21 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -127,6 +127,7 @@ module ActionView def say_no_to_protect_against_forgery! _helpers.module_eval do + remove_method :protect_against_forgery? if method_defined?(:protect_against_forgery?) def protect_against_forgery? false end -- cgit v1.2.3