Commit 7d9bdac6 authored by Lin Jen-Shin's avatar Lin Jen-Shin

We could just sum with SQL

parent 47ed793a
...@@ -79,7 +79,7 @@ module Ci ...@@ -79,7 +79,7 @@ module Ci
end end
def self.duration def self.duration
where.not(duration: nil).pluck(:duration).inject(0, &:+) where.not(duration: nil).sum(:duration)
end end
def project_id def project_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment