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:
Dan Rice 2014-03-30 16:47:21 -04:00
parent 8c90dd8f48
commit ece69b8540

View file

@ -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)