#245: rollback some changes of BuildListObserver
This commit is contained in:
parent
b69a238a3a
commit
b5e22bb5db
|
@ -21,7 +21,7 @@ class BuildListObserver < ActiveRecord::Observer
|
||||||
end
|
end
|
||||||
build_count = statistic.build_count
|
build_count = statistic.build_count
|
||||||
new_av_time = ( statistic.average_build_time * build_count + record.duration ) / ( build_count + 1 )
|
new_av_time = ( statistic.average_build_time * build_count + record.duration ) / ( build_count + 1 )
|
||||||
statistic.update_attributes(:average_build_time => new_av_time, :build_count => build_count)
|
statistic.update_attributes(:average_build_time => new_av_time, :build_count => build_count + 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue