]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3482 Prevent removing a filter which is used by a widget
authorDavid Gageot <david@gageot.net>
Fri, 18 May 2012 10:04:29 +0000 (12:04 +0200)
committerDavid Gageot <david@gageot.net>
Fri, 18 May 2012 10:28:00 +0000 (12:28 +0200)
When a dashboard was deleted, its widgets were deleted but not its
widget properties.

sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb

index 3562e5232efd3991de8695a40df00982be0f8fae..9341d36d57a825869e823610cd4d442bb22dc8d0 100644 (file)
@@ -23,7 +23,7 @@ class Dashboard < ActiveRecord::Base
 
   belongs_to :user
 
-  has_many :widgets, :include => 'properties', :dependent => :delete_all
+  has_many :widgets, :include => 'properties', :dependent => :destroy
   has_many :active_dashboards, :dependent => :destroy
 
   validates_length_of :name, :within => 1..256