aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-10-01 16:18:19 +0200
committerDavid Gageot <david@gageot.net>2012-10-01 16:36:58 +0200
commit92ad85d9a740553f4c971b8732b34121dafd5af7 (patch)
tree3c1c132e09b36c40a17da98645db463ab5a066e9 /sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
parent57c87a64a0a545ad81f3859b57d4962260ef6ee3 (diff)
downloadsonarqube-92ad85d9a740553f4c971b8732b34121dafd5af7.tar.gz
sonarqube-92ad85d9a740553f4c971b8732b34121dafd5af7.zip
SONAR-3529 Property field validation
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
index 0db50cd74b9..bbb052d4261 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
@@ -38,6 +38,8 @@ class SettingsController < ApplicationController
access_denied if (@resource.nil? && !is_admin?)
load_properties()
+
+ @updated_properties = {}
save_properties(resource_id)
save_property_sets(resource_id)
@@ -46,7 +48,6 @@ class SettingsController < ApplicationController
private
- # TODO: Validation
def save_property_sets(resource_id)
(params[:property_sets] || []).each do |key, value|
set_keys = drop_trailing_blank_values(value)
@@ -57,15 +58,16 @@ class SettingsController < ApplicationController
params[key].each do |field_key, field_values|
field_values.each_with_index do |field_value, index|
set_key = set_keys[index]
- Property.set("#{key}.#{set_key}.#{field_key}", field_value, resource_id) if set_key
+ if set_key
+ field_property_key = "#{key}.#{set_key}.#{field_key}"
+ @updated_properties[field_property_key] = Property.set(field_property_key, field_value, resource_id)
+ end
end
end
end
end
def save_properties(resource_id)
- @updated_properties = {}
-
(params[:settings] || []).each do |key, value|
if value.kind_of? Array
value = drop_trailing_blank_values(value)