Simplification
This commit is contained in:
parent
b6e4bd8a99
commit
f68482f850
2 changed files with 3 additions and 9 deletions
|
|
@ -18,14 +18,8 @@ class Screenshot < ApplicationRecord
|
|||
|
||||
|
||||
# Calculate how many days ago this screenshot has been uploaded
|
||||
def age_days
|
||||
if self.created_at
|
||||
seconds = Time.now - self.created_at
|
||||
else
|
||||
seconds = 0
|
||||
end
|
||||
days = (seconds/86400).to_i
|
||||
days ? "#{days} days ago" : 'today'
|
||||
def age
|
||||
time_ago_in_words(self.created_at)
|
||||
end
|
||||
|
||||
# Return caption for full-screen screenshots.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue