From ed99958d394d15e52102d3d103655509c7499e9e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 26 Aug 2016 17:08:49 +0200 Subject: [PATCH] Improved keep_certain_attributes check. --- app/controllers/settings_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index ffee83cfe..e4bba300e 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -96,10 +96,12 @@ class SettingsController < ApplicationController [:name, :area, :state_initial, :frontend, :options].each { |key| params.delete(key) } - [:online_service_disable, :permission, :render].each { |key| - params[:preferences].delete(key) - } - params[:preferences].merge!(setting.preferences) + if !params[:preferences].empty? + [:online_service_disable, :permission, :render].each { |key| + params[:preferences].delete(key) + } + params[:preferences].merge!(setting.preferences) + end params end