Cleanup html options for collection logic a bit
This commit is contained in:
parent
26a959c1af
commit
04f70e8a5d
|
@ -217,13 +217,12 @@ module SimpleForm
|
||||||
html_options = html_options.dup
|
html_options = html_options.dup
|
||||||
|
|
||||||
[:checked, :selected, :disabled].each do |option|
|
[:checked, :selected, :disabled].each do |option|
|
||||||
next unless options[option]
|
next unless current_option = options[option]
|
||||||
|
|
||||||
|
accept = if current_option.respond_to?(:call)
|
||||||
accept = if options[option].respond_to?(:call)
|
current_option.call(item)
|
||||||
options[option].call(item)
|
|
||||||
else
|
else
|
||||||
Array(options[option]).include?(value)
|
Array(current_option).include?(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
if accept
|
if accept
|
||||||
|
|
Loading…
Reference in New Issue