mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 17:52:39 +02:00
no deleted/banned/crashing sites in followings/followers
This commit is contained in:
parent
64fb2cf4c4
commit
205036004b
1 changed files with 11 additions and 1 deletions
|
@ -319,7 +319,7 @@ class Site < Sequel::Model
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_following?(site)
|
def is_following?(site)
|
||||||
followings_dataset.select(:id).filter(site_id: site.id).first ? true : false
|
followings_dataset.select(:follows__id).filter(site_id: site.id).first ? true : false
|
||||||
end
|
end
|
||||||
|
|
||||||
def toggle_follow(site)
|
def toggle_follow(site)
|
||||||
|
@ -468,6 +468,16 @@ class Site < Sequel::Model
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Who this site follows
|
||||||
|
def followings_dataset
|
||||||
|
super.select_all(:follows).inner_join(:sites, :id=>:site_id).exclude(:sites__is_deleted => true).exclude(:sites__is_banned => true).exclude(:sites__is_crashing => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Who this site is following
|
||||||
|
def follows_dataset
|
||||||
|
super.select_all(:follows).inner_join(:sites, :id=>:actioning_site_id).exclude(:sites__is_deleted => true).exclude(:sites__is_banned => true).exclude(:sites__is_crashing => true)
|
||||||
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
def follows_dataset
|
def follows_dataset
|
||||||
super.where(Sequel.~(site_id: blocking_site_ids))
|
super.where(Sequel.~(site_id: blocking_site_ids))
|
||||||
|
|
Loading…
Add table
Reference in a new issue