From: Julien Lancelot Date: Thu, 21 Mar 2013 09:48:15 +0000 (+0100) Subject: SONAR-3839 A followed dashboard shouldn't be flagged as unfollowed after being edited X-Git-Tag: 3.6~822 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1bf48805965258e530d9ee44f5bdef327e6d18ab;p=sonarqube.git SONAR-3839 A followed dashboard shouldn't be flagged as unfollowed after being edited --- 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