Merge pull request #3909 from humzashah/reduced-time-operation

reused value of `Time.now` in a method
This commit is contained in:
Sam 2015-12-02 09:01:22 +11:00
commit 6577f3c1ed
1 changed files with 6 additions and 2 deletions

View File

@ -1,8 +1,12 @@
module AgeWords
def self.age_words(secs)
return "—" if secs.blank?
return FreedomPatches::Rails4.distance_of_time_in_words(Time.now, Time.now + secs)
if secs.blank?
"—"
else
now = Time.now
FreedomPatches::Rails4.distance_of_time_in_words(now, now + secs)
end
end
end