mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
parent
32f9fd1e51
commit
fb7f21fbe9
@ -18,8 +18,8 @@ class EnableContentSecurityPolicyForNewSites < ActiveRecord::Migration[5.2]
|
||||
end
|
||||
|
||||
def instance_is_new?
|
||||
post = DB.query_single("SELECT created_at FROM posts ORDER BY created_at ASC LIMIT 1")
|
||||
return post.blank? || (post.present? && post.first > 1.week.ago)
|
||||
dates = DB.query_single("SELECT created_at FROM posts ORDER BY created_at ASC LIMIT 1")
|
||||
dates.empty? || dates.first > 1.week.ago
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user