aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-12-09 20:32:39 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-12-09 20:32:39 +0100
commit747e52172260bb174fbfecb8f7248e488920c85a (patch)
treeb905ce436398d5ddae4a8ad624a9d34f10985dbd /sonar-server
parenta165e62535109185b709c37380c831e909b0bdee (diff)
downloadsonarqube-747e52172260bb174fbfecb8f7248e488920c85a.tar.gz
sonarqube-747e52172260bb174fbfecb8f7248e488920c85a.zip
Fix backward-compatibility of db migration with 3.4 milestone 5
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_existing_measure_filters.rb (renamed from sonar-server/src/main/webapp/WEB-INF/db/migrate/357_move_existing_measure_filters.rb)1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/361_move_filter_widgets.rb (renamed from sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_filter_widgets.rb)4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/362_drop_filter_tables.rb (renamed from sonar-server/src/main/webapp/WEB-INF/db/migrate/361_drop_filter_tables.rb)0
4 files changed, 6 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb
index de0c2d546d4..db90a4b5853 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb
@@ -95,6 +95,10 @@ class MeasureFilter < ActiveRecord::Base
@require_links
end
+ def require_authentication?
+ criteria[:onFavourites]=='true'
+ end
+
def criteria(key=nil)
@criteria ||= HashWithIndifferentAccess.new
if key
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/357_move_existing_measure_filters.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_existing_measure_filters.rb
index 7906ec0af08..57e4a334e46 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/357_move_existing_measure_filters.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_existing_measure_filters.rb
@@ -68,7 +68,6 @@ class MoveExistingMeasureFilters < ActiveRecord::Migration
new_filter.data = data.join('|') unless data.empty?
new_filter.save
- Filter.delete(old_filter.id)
end
def self.move_columns(old_filter, data)
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_filter_widgets.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/361_move_filter_widgets.rb
index 1b30481a7a7..12d88b0e74a 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_filter_widgets.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/361_move_filter_widgets.rb
@@ -51,9 +51,9 @@ class MoveFilterWidgets < ActiveRecord::Migration
filter = MeasureFilter.find(:first, :conditions => ['name=? and user_id=?', old_filter.name, old_filter.user_id]) if old_filter.user_id
filter = MeasureFilter.find(:first, :conditions => ['name=? and user_id is null', old_filter.name]) unless filter
if filter
- widget_property.text_value = filter.id.to_s
+ widget_property.text_value=filter.id.to_s
widget_property.save
- widget.widget_key = (filter.data.include?('display=treemap') ? 'measure_filter_treemap' : 'measure_filter_list')
+ widget.widget_key=(filter.data.include?('display=treemap') ? 'measure_filter_treemap' : 'measure_filter_list')
widget.save
end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/361_drop_filter_tables.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/362_drop_filter_tables.rb
index 00a00508ec6..00a00508ec6 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/361_drop_filter_tables.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/362_drop_filter_tables.rb