Cleanup html options for collection logic a bit

This commit is contained in:
Carlos Antonio da Silva 2012-02-14 08:37:47 -02:00
parent 26a959c1af
commit 04f70e8a5d
1 changed files with 4 additions and 5 deletions

View File

@ -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