mirror of
https://github.com/neocities/neocities.git
synced 2025-08-02 07:41:52 +02:00
separate site and account settings context
This commit is contained in:
parent
7e36dc83f8
commit
d0970cdf9e
16 changed files with 515 additions and 443 deletions
|
@ -162,7 +162,7 @@ class Site < Sequel::Model
|
|||
if parent?
|
||||
return children
|
||||
else
|
||||
sites = (parent + children)
|
||||
sites = ([parent] + children)
|
||||
sites.delete self
|
||||
sites
|
||||
end
|
||||
|
@ -204,6 +204,14 @@ class Site < Sequel::Model
|
|||
false
|
||||
end
|
||||
|
||||
def owner
|
||||
parent? ? self : parent
|
||||
end
|
||||
|
||||
def owned_by?(site)
|
||||
account_sites.include? site
|
||||
end
|
||||
|
||||
def is_following?(site)
|
||||
followings_dataset.select(:id).filter(site_id: site.id).first ? true : false
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue