mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Hash#fetch FTW
This commit is contained in:
parent
239b8dcfa8
commit
b318d34282
1 changed files with 2 additions and 6 deletions
|
@ -20,16 +20,12 @@ module SimpleForm
|
|||
protected
|
||||
|
||||
def apply_default_collection_options!(options)
|
||||
unless options.key?(:item_wrapper_tag)
|
||||
options[:item_wrapper_tag] = SimpleForm.item_wrapper_tag
|
||||
end
|
||||
options[:item_wrapper_tag] ||= options.fetch(:item_wrapper_tag, SimpleForm.item_wrapper_tag)
|
||||
options[:item_wrapper_class] = [
|
||||
item_wrapper_class, options[:item_wrapper_class], SimpleForm.item_wrapper_class
|
||||
].compact.presence
|
||||
|
||||
unless options.key?(:collection_wrapper_tag)
|
||||
options[:collection_wrapper_tag] = SimpleForm.collection_wrapper_tag
|
||||
end
|
||||
options[:collection_wrapper_tag] ||= options.fetch(:collection_wrapper_tag, SimpleForm.collection_wrapper_tag)
|
||||
options[:collection_wrapper_class] = [
|
||||
options[:collection_wrapper_class], SimpleForm.collection_wrapper_class
|
||||
].compact.presence
|
||||
|
|
Loading…
Reference in a new issue