mirror of
https://github.com/neocities/neocities.git
synced 2025-07-03 01:23:22 +02:00
show some site change activity in global activity
This commit is contained in:
parent
293ce32b16
commit
3e8514fde4
2 changed files with 23 additions and 1 deletions
|
@ -14,6 +14,7 @@ class Event < Sequel::Model
|
|||
|
||||
DEFAULT_GLOBAL_LIMIT = 300
|
||||
GLOBAL_VIEWS_MINIMUM = 5
|
||||
GLOBAL_VIEWS_SITE_CHANGE_MINIMUM = 1000
|
||||
|
||||
def self.news_feed_default_dataset
|
||||
select_all(:events).
|
||||
|
@ -33,6 +34,14 @@ class Event < Sequel::Model
|
|||
where(site_change_id: nil)
|
||||
end
|
||||
|
||||
def self.global_site_changes_dataset
|
||||
news_feed_default_dataset.
|
||||
where{views > GLOBAL_VIEWS_SITE_CHANGE_MINIMUM}.
|
||||
exclude(is_nsfw: true).
|
||||
exclude(is_crashing: true).
|
||||
exclude(site_change_id: nil)
|
||||
end
|
||||
|
||||
def created_by?(site)
|
||||
return true if actioning_site_id == site.id
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue