From: Sébastien Lesaint Date: Fri, 24 Jun 2016 15:38:08 +0000 (+0200) Subject: SONAR-7719 remove version now remove it from snapshot X-Git-Tag: 6.0-RC1~243 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=708f380fc38b072c86bd451b8dff118d85688266;p=sonarqube.git SONAR-7719 remove version now remove it from snapshot --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb index 6a8028e977f..9215bbe1934 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb @@ -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! diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb index 879ed2c648b..5bdfd72f561 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb @@ -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