From: David Gageot Date: Fri, 18 May 2012 10:04:29 +0000 (+0200) Subject: SONAR-3482 Prevent removing a filter which is used by a widget X-Git-Tag: 3.1~174 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7857123478be90b7e49d73f414adaf447f5512b7;p=sonarqube.git SONAR-3482 Prevent removing a filter which is used by a widget When a dashboard was deleted, its widgets were deleted but not its widget properties. --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb index 3562e5232ef..9341d36d57a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb @@ -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