]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7719 remove version now remove it from snapshot 1065/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 24 Jun 2016 15:38:08 +0000 (17:38 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 28 Jun 2016 12:07:24 +0000 (14:07 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb

index 6a8028e977f1f6e8ef353f78dd5ba8b4f91ff156..9215bbe1934dd5967c09b153fa672da87a292e59 100644 (file)
@@ -322,7 +322,7 @@ class ProjectController < ApplicationController
     access_denied unless is_admin?(parent_snapshot)
 
     # We update all the related snapshots to have the same version as the next snapshot
-    next_snapshot = Snapshot.find(:first, :conditions => ['created_at>? and component_uuid=?', parent_snapshot.created_at.to_i*1000, parent_snapshot.component_uuid], :order => 'created_at asc')
+    next_snapshot = Snapshot.find(:first, :conditions => ['created_at>? and component_uuid=?', parent_snapshot.created_at_long, parent_snapshot.component_uuid], :order => 'created_at asc')
     parent_snapshot.version = next_snapshot.version
     parent_snapshot.save!
 
index 879ed2c648b1a1bb66ba00427afb7a985ad55b26..5bdfd72f561d48ad4d9323318f05f60f03438129 100644 (file)
@@ -37,7 +37,11 @@ class Snapshot < ActiveRecord::Base
   def created_at
     long_to_date(:created_at)
   end
-  
+
+  def created_at_long
+    read_attribute(:created_at)
+  end
+
   def build_date
     long_to_date(:build_date)
   end