Method: Decidim::System::FileUploadSettingsForm#final

Defined in:
decidim-system/app/forms/decidim/system/file_upload_settings_form.rb

#finalObject

This turns the attributes passed from the view into the final configuration array. Due to the UI component used for the array values, those values need to be handled as a single comma separated string in the view layer. Before we save those attributes, they need to be converted into arrays which is what this method does.



45
46
47
48
49
50
51
# File 'decidim-system/app/forms/decidim/system/file_upload_settings_form.rb', line 45

def final
  to_h.tap do |attr|
    csv_attributes.each do |key|
      attr[key] = csv_array_setting(attr[key])
    end
  end
end