From 04f70e8a5de8c0ba21dd86d2495015451cbffd22 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 14 Feb 2012 08:37:47 -0200 Subject: [PATCH] Cleanup html options for collection logic a bit --- lib/simple_form/action_view_extensions/builder.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/simple_form/action_view_extensions/builder.rb b/lib/simple_form/action_view_extensions/builder.rb index 315010ac..e5bf0965 100644 --- a/lib/simple_form/action_view_extensions/builder.rb +++ b/lib/simple_form/action_view_extensions/builder.rb @@ -217,13 +217,12 @@ module SimpleForm html_options = html_options.dup [:checked, :selected, :disabled].each do |option| - next unless options[option] + next unless current_option = options[option] - - accept = if options[option].respond_to?(:call) - options[option].call(item) + accept = if current_option.respond_to?(:call) + current_option.call(item) else - Array(options[option]).include?(value) + Array(current_option).include?(value) end if accept