Skip to content
This repository
Browse code

Silence warning: instance variable @auto_index not initialized

  • Loading branch information...
commit ae5e2f591961fc18bb90426204c90f9b99dc8097 1 parent 8073e47
Bryan Helmkamp authored
2  actionpack/lib/action_view/helpers/date_helper.rb
@@ -935,7 +935,7 @@ def datetime_selector(options, html_options)
935 935
           options[:field_name]           = @method_name
936 936
           options[:include_position]     = true
937 937
           options[:prefix]             ||= @object_name
938  
-          options[:index]                = @auto_index if @auto_index && !options.has_key?(:index)
  938
+          options[:index]                = @auto_index if defined?(@auto_index) && @auto_index && !options.has_key?(:index)
939 939
           options[:datetime_separator] ||= ' — '
940 940
           options[:time_separator]     ||= ' : '
941 941
 

0 notes on commit ae5e2f5

Please sign in to comment.
Something went wrong with that request. Please try again.