measures_order = "project_measures.value #{'DESC' if metrics.first.direction<0}"
end
end
-
+
+ measures_conditions << 'project_measures.committer IS NULL'
add_rule_filters(measures_conditions, measures_values)
add_characteristic_filters(measures_conditions, measures_values)
@measures_by_sid={}
unless @metrics.empty?
- sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rules_category_id IS NULL AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL']
+ sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rules_category_id IS NULL AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.committer IS NULL']
sql_values = {:rid => @resource.id, :status => Snapshot::STATUS_PROCESSED}
if params[:fromDateTime]
'metric_id' => mids,
'rule_id' => nil,
'rule_priority' => nil,
- 'characteristic_id' => nil}))
+ 'characteristic_id' => nil,
+ 'committer' => nil}))
end
measures
else
snapshot_by_id[s.id]=s
end
- measures=ProjectMeasure.find(:all, :conditions => {:rule_id => nil, :rule_priority => nil, :snapshot_id => @sids, :characteristic_id => nil})
+ measures=ProjectMeasure.find(:all, :conditions => {:rule_id => nil, :rule_priority => nil, :snapshot_id => @sids, :characteristic_id => nil, :committer => nil})
rows_by_metric_id={}
@rows=[]
return nil if items.nil?
items.each do |item|
metric = Metric.by_name(metric_name)
- return item if (item && metric && item.metric_id==metric.id && item.rule_priority.nil? && item.characteristic_id.nil?)
+ return item if (item && metric && item.metric_id==metric.id && item.rule_priority.nil? && item.characteristic_id.nil? && item.committer.nil?)
end
nil
end
conditions += ' AND project_measures.characteristic_id IS NULL'
end
+ conditions += ' AND project_measures.committer IS NULL'
+
@measures=ProjectMeasure.find(:all,
:select => "project_measures.id,project_measures.metric_id,project_measures.#{value_column},project_measures.text_value,project_measures.alert_status,project_measures.alert_text,project_measures.snapshot_id",
:joins => :snapshot,
# load measures
#
if @metric_ids.size>0
- measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and snapshot_id in (?)', @page_sids])
+ measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and committer is null and snapshot_id in (?)', @page_sids])
measures.each do |m|
snapshot=@snapshots_by_id[m.snapshot_id]
" s.status='%s' and " +
' s.project_id=%s and m.metric_id=%s ', Snapshot::STATUS_PROCESSED, self.id, metric_id]) +
' and m.rule_id IS NULL and m.rule_priority IS NULL' +
+ ' and m.committer IS NULL' +
' order by s.created_at'
create_chart_measures(Project.connection.select_all(sql), 'created_at', 'value')
end
belongs_to :root_snapshot, :class_name => 'Snapshot', :foreign_key => 'root_snapshot_id'
belongs_to :characteristic
- has_many :measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL'
- has_many :rulemeasures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NOT NULL AND characteristic_id IS NULL', :include => 'rule'
- has_many :characteristic_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NOT NULL'
+ has_many :measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND committer IS NULL'
+ has_many :rulemeasures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NOT NULL AND characteristic_id IS NULL AND committer IS NULL', :include => 'rule'
+ has_many :characteristic_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NOT NULL AND committer IS NULL'
has_many :events, :dependent => :destroy, :order => 'event_date DESC'
has_one :source, :class_name => 'SnapshotSource', :dependent => :destroy
# temporary fix for SONAR-1098
snapshots=snapshots[0...999]
measures = ProjectMeasure.find(:all,
- :conditions => ['characteristic_id IS NULL and rule_id IS NULL and rule_priority IS NULL and metric_id IN (?) and snapshot_id IN (?)',
+ :conditions => ['committer IS NULL and characteristic_id IS NULL and rule_id IS NULL and rule_priority IS NULL and metric_id IN (?) and snapshot_id IN (?)',
[size_metric.id, color_metric.id], snapshots.map{|s| s.id}])
end
Sonar::Treemap.new(measures_hash_by_snapshot(snapshots, measures), width, height, size_metric, color_metric)
" and s.status=? " +
" and s.project_id=? " +
" and m.metric_id in (?) " +
- " and m.rule_priority is null and m.characteristic_id is null"
+ " and m.rule_priority is null and m.characteristic_id is null and m.committer is null"
if (options[:from])
sql += ' and s.created_at>=?'
end