From 1bf48805965258e530d9ee44f5bdef327e6d18ab Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 21 Mar 2013 10:48:15 +0100 Subject: [PATCH] SONAR-3839 A followed dashboard shouldn't be flagged as unfollowed after being edited --- .../WEB-INF/app/controllers/dashboards_controller.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb index e9a999ab673..43ec815adb5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb @@ -28,7 +28,7 @@ class DashboardsController < ApplicationController @global = !params[:resource] @actives=ActiveDashboard.user_dashboards(current_user, @global) - @shared_dashboards=Dashboard.find(:all, :conditions => ['(shared=? or user_id=?) and is_global=?', true, current_user.id, @global]) + @shared_dashboards=Dashboard.all(:conditions => ['(shared=? or user_id=?) and is_global=?', true, current_user.id, @global]) active_ids=@actives.map(&:dashboard_id) @shared_dashboards.reject! { |d| active_ids.include?(d.id) } @shared_dashboards=Api::Utils.insensitive_sort(@shared_dashboards, &:name) @@ -83,11 +83,7 @@ class DashboardsController < ApplicationController if dashboard.editable_by?(current_user) load_dashboard_from_params(dashboard) - if dashboard.save - unless dashboard.shared? - ActiveDashboard.destroy_all(:dashboard_id => dashboard.id) - end - else + unless dashboard.save flash[:error]=dashboard.errors.full_messages.join('
') end end -- 2.39.5