aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-23 22:12:30 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-23 22:12:30 +0200
commit5b7386b8b677e37f225b91807459fffff096bc7c (patch)
tree142b095b3fab4a6289a8efbdad8caf49d8a36785
parent97da706a3ed800e3a747ef37bd60216fcb941988 (diff)
downloadsonarqube-5b7386b8b677e37f225b91807459fffff096bc7c.tar.gz
sonarqube-5b7386b8b677e37f225b91807459fffff096bc7c.zip
SONAR-4979 fix compatibility with RoR dev mode
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/526_remove_unshared_active_dashboards.rb (renamed from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/526_remove_active_dashboards_linked_on_unshared_dashboards.rb)8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/526_remove_active_dashboards_linked_on_unshared_dashboards.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/526_remove_unshared_active_dashboards.rb
index 74710591d2e..6c35790ce4e 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/526_remove_active_dashboards_linked_on_unshared_dashboards.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/526_remove_unshared_active_dashboards.rb
@@ -22,13 +22,15 @@
# SonarQube 4.3
# SONAR-4979
#
-class RemoveActiveDashboardsLinkedOnUnsharedDashboards < ActiveRecord::Migration
+class RemoveUnsharedActiveDashboards < ActiveRecord::Migration
class Dashboard < ActiveRecord::Base
+ set_table_name 'dashboards'
end
class ActiveDashboard < ActiveRecord::Base
- belongs_to :dashboard
+ set_table_name 'active_dashboards'
+ belongs_to :dashboard, :class_name => 'Dashboard'
end
def self.up
@@ -36,7 +38,7 @@ class RemoveActiveDashboardsLinkedOnUnsharedDashboards < ActiveRecord::Migration
ActiveDashboard.reset_column_information
# Delete every active_dashboards linked on unshared dashboard not owned by the user
- ActiveDashboard.all(:include => :dashboard, :conditions => ['dashboards.shared=? AND active_dashboards.user_id<>dashboards.user_id', false]).each {|ad| ad.delete}
+ ActiveDashboard.all(:joins => 'inner join dashboards on dashboards.id=active_dashboards.dashboard_id', :conditions => ['dashboards.shared=? AND active_dashboards.user_id<>dashboards.user_id', false]).each {|ad| ad.delete}
end
end