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