]> source.dussan.org Git - sonarqube.git/commitdiff
Fix migration of measure filters
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Dec 2012 15:01:37 +0000 (16:01 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Dec 2012 15:01:37 +0000 (16:01 +0100)
sonar-server/src/main/webapp/WEB-INF/db/migrate/357_move_existing_measure_filters.rb

index 3fad50fc1527ec6f906b2a78cbd3efbdad493cd7..6b83c961d89c0e16b998a4343640ff43af7337bf 100644 (file)
@@ -118,9 +118,9 @@ class MoveExistingMeasureFilters < ActiveRecord::Migration
         data << "c#{metric_criteria_id}_metric=#{old.kee}"
         data << "c#{metric_criteria_id}_op=#{operator_code(old.operator)}"
         data << "c#{metric_criteria_id}_val=#{old.value}"
-        data << "c#{metric_criteria_id}_period=#{old.period}" if old.period
+        data << "c#{metric_criteria_id}_period=#{old_filter.period_index}" if old_filter.period_index
         metric_criteria_id += 1
-      elsif old.family=='direct-children' && op.text_value=='true'
+      elsif old.family=='direct-children' && old.text_value=='true'
         data << "onBaseComponents=true"
       end
     end