]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3512 Follow newly created dashboard
authorDavid Gageot <david@gageot.net>
Fri, 29 Jun 2012 14:26:46 +0000 (16:26 +0200)
committerDavid Gageot <david@gageot.net>
Fri, 29 Jun 2012 14:26:46 +0000 (16:26 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb

index b07c19fc1c5f3a233fee0da1abb5b6cd3f2f6caf..e9a999ab673dee8501e4a9d36250358e36edf621 100644 (file)
@@ -59,6 +59,7 @@ class DashboardsController < ApplicationController
     elsif @dashboard.save
       add_default_dashboards_if_first_user_dashboard(@dashboard.global?)
       last_index=current_user.active_dashboards.max_by(&:order_index).order_index
+      current_user.active_dashboards.create(:dashboard => @dashboard, :user => current_user, :order_index => (last_index+1))
 
       redirect_to :action => 'index', :resource => params[:resource], :highlight => @dashboard.id
     else