]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3529 Fix deletion of property sets
authorDavid Gageot <david@gageot.net>
Tue, 2 Oct 2012 11:30:41 +0000 (13:30 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 2 Oct 2012 11:30:50 +0000 (13:30 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET.html.erb

index 83741be6f9f15200b3aa4d12dff70276d5f4a420..8125a3036799ace7743e795e13083bb4321aa191 100644 (file)
@@ -56,7 +56,7 @@ class SettingsController < ApplicationController
 
   def update_property_sets(resource_id)
     (params[:property_sets] || []).each do |key, set_keys|
-      Property.with_key_prefix(key + '.').delete_all
+      Property.with_key_prefix(key + '.').with_resource(resource_id).delete_all
       update_property(key, set_keys, resource_id)
 
       params[key].each do |field_key, field_values|
index 20f34618e467002cbba9a4529db29ca751b4b2e9..ae8159a9df4655344b236b9dc747410ab2b6056c 100644 (file)
@@ -1,14 +1,11 @@
 <% choices = Property.values(property.propertySetKey).reject(&:blank?) -%>
 <% prompt = [[message('default'), '']] -%>
 
-<% if choices.exclude? value -%>
+<% if !value.blank? && (choices.exclude? value) -%>
+  <%= image_tag 'exclamation.png' -%>
   <% missing = [[h(value + ' <' + message('deleted') + '>'), value]] -%>
 <% else -%>
   <% missing = [] -%>
 <% end -%>
 
-<%= select_tag name, options_for_select(prompt + choices + missing, value), :id => id -%>
-
-<% if choices.exclude? value -%>
-  <%= image_tag 'exclamation.png' -%>
-<% end -%>
+<%= select_tag name, options_for_select(prompt + choices + missing, value), :id => id -%>
\ No newline at end of file