mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-25 08:34:08 +01:00
Statistics for longest running projects now includes completed and hidden projects. fixes #1725
This commit is contained in:
parent
ff9edcc309
commit
2883d1b7f4
6 changed files with 57 additions and 27 deletions
|
|
@ -138,6 +138,14 @@ class Project < ActiveRecord::Base
|
|||
@age_in_days ||= (Time.current.to_date - created_at.to_date).to_i + 1
|
||||
end
|
||||
|
||||
def running_time
|
||||
if completed_at.nil?
|
||||
return age_in_days
|
||||
else
|
||||
return (completed_at.to_date - created_at.to_date).to_i + 1
|
||||
end
|
||||
end
|
||||
|
||||
def self.import(filename, params, user)
|
||||
count = 0
|
||||
CSV.foreach(filename, headers: true) do |row|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue