diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-15 15:28:47 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-15 15:28:47 +0100 |
commit | dffa8a7ba45850ca4bcb42bfda1d1492faf18271 (patch) | |
tree | 39ff51d9b5eb5ab6b4d110cb3ed07290afc4ad8c | |
parent | dc619ea978982e93a605f2908fc7b2e43bee310a (diff) | |
download | sonarqube-dffa8a7ba45850ca4bcb42bfda1d1492faf18271.tar.gz sonarqube-dffa8a7ba45850ca4bcb42bfda1d1492faf18271.zip |
Fix loading of Filter
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/db/migrate/115_create_filters.rb | 9 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/db/migrate/168_add_periods_to_filters.rb | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/115_create_filters.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/115_create_filters.rb index 360c06c21af..ea66e726b67 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/115_create_filters.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/115_create_filters.rb @@ -63,6 +63,9 @@ class CreateFilters < ActiveRecord::Migration private def self.add_default_filters + ActiveFilter.reset_column_information + Filter.reset_column_information + projects_filter=create_projects_filter() ActiveFilter.create(:filter => projects_filter, :user_id => nil, :order_index => 1) @@ -76,7 +79,7 @@ class CreateFilters < ActiveRecord::Migration end def self.create_projects_filter - projects_filter=::Filter.new(:name => 'Projects', :shared => true, :favourites => false, :default_view => ::Filter::VIEW_LIST) + projects_filter=Filter.new(:name => 'Projects', :shared => true, :favourites => false, :default_view => ::Filter::VIEW_LIST) projects_filter.criteria<<Criterion.new_for_qualifiers([Project::QUALIFIER_PROJECT]) projects_filter.columns.build(:family => 'metric', :kee => 'alert_status', :order_index => 1) projects_filter.columns.build(:family => 'name', :order_index => 2, :sort_direction => 'ASC') @@ -120,7 +123,7 @@ class CreateFilters < ActiveRecord::Migration size_metric=Property.value('sonar.core.treemap.sizemetric', nil, 'ncloc') color_metric=Property.value('sonar.core.treemap.colormetric', nil, 'violations_density') - treemap_filter=::Filter.new(:name => 'Treemap', :shared => true, :favourites => false, :default_view => ::Filter::VIEW_TREEMAP) + treemap_filter=Filter.new(:name => 'Treemap', :shared => true, :favourites => false, :default_view => ::Filter::VIEW_TREEMAP) treemap_filter.criteria<<Criterion.new_for_qualifiers([Project::QUALIFIER_PROJECT]) treemap_filter.columns.build(:family => 'name', :order_index => 1) treemap_filter.columns.build(:family => 'metric', :kee => size_metric, :order_index => 2) @@ -133,7 +136,7 @@ class CreateFilters < ActiveRecord::Migration end def self.create_favourites_filter - favourites_filter=::Filter.new(:name => 'My favourites', :shared => true, :favourites => true, :default_view => ::Filter::VIEW_LIST) + favourites_filter=Filter.new(:name => 'My favourites', :shared => true, :favourites => true, :default_view => ::Filter::VIEW_LIST) favourites_filter.criteria<<Criterion.new_for_qualifiers(Project::QUALIFIERS) favourites_filter.columns.build(:family => 'metric', :kee => 'alert_status', :order_index => 1) favourites_filter.columns.build(:family => 'name', :order_index => 2, :sort_direction => 'ASC') diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/168_add_periods_to_filters.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/168_add_periods_to_filters.rb index 48f4d189467..f6355c108d3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/168_add_periods_to_filters.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/168_add_periods_to_filters.rb @@ -27,6 +27,9 @@ class AddPeriodsToFilters < ActiveRecord::Migration add_column :filters, :period_index, :integer, :null => true add_column :filter_columns, :variation, :boolean, :null => true add_column :criteria, :variation, :boolean, :null => true + ::Filter.reset_column_information + Criterion.reset_column_information + FilterColumn.reset_column_information end end |