mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
Use Date class to assist with date math in Project model
Fixes an intermittent failure in ProjectTest#test_age_in_days
This commit is contained in:
parent
8c90dd8f48
commit
ece69b8540
1 changed files with 1 additions and 1 deletions
|
|
@ -136,7 +136,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def age_in_days
|
||||
@age_in_days ||= ((Time.now.utc - created_at).to_i / 1.day) + 1
|
||||
@age_in_days ||= (Time.now.to_date - created_at.to_date).to_i + 1
|
||||
end
|
||||
|
||||
def self.import(filename, params, user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue