mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:50:26 -06:00
Add Topic#age_in_days for determining age of topic
This commit is contained in:
parent
c32399a80b
commit
54a798eb12
@ -193,6 +193,10 @@ class Topic < ActiveRecord::Base
|
||||
@post_numbers ||= posts.order(:post_number).pluck(:post_number)
|
||||
end
|
||||
|
||||
def age_in_days
|
||||
((Time.zone.now - created_at) / 1.day).round
|
||||
end
|
||||
|
||||
def has_meta_data_boolean?(key)
|
||||
meta_data_string(key) == 'true'
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user