의 미러
https://github.com/SonarSource/sonarqube.git
synced 2024-08-11 14:10:17 +02:00
manual_measures - fix mapping in ruby code
This commit is contained in:
부모
bdac02bee4
커밋
24de4549b0
@ -26,6 +26,19 @@ class ManualMeasure < ActiveRecord::Base
|
||||
validates_length_of :description, :maximum => 4000, :allow_nil => true, :allow_blank => true
|
||||
validate :validate_metric, :validate_value
|
||||
|
||||
def created_at
|
||||
long_to_date(:created_at)
|
||||
end
|
||||
|
||||
def updated_at
|
||||
long_to_date(:updated_at)
|
||||
end
|
||||
|
||||
def long_to_date(attribute)
|
||||
date_in_long = read_attribute(attribute)
|
||||
Time.at(date_in_long/1000) if date_in_long
|
||||
end
|
||||
|
||||
def metric
|
||||
@metric ||=
|
||||
begin
|
||||
@ -61,7 +74,7 @@ class ManualMeasure < ActiveRecord::Base
|
||||
if snapshot.nil?
|
||||
snapshot=resource.last_snapshot
|
||||
end
|
||||
snapshot && updated_at && snapshot.created_at<Time.at(updated_at/1000)
|
||||
snapshot && updated_at && snapshot.created_at<updated_at
|
||||
end
|
||||
|
||||
def formatted_value
|
||||
|
불러오는 중...
Reference in New Issue
Block a user