mirror of
https://github.com/neocities/neocities.git
synced 2025-07-23 19:10:40 +02:00
continued work on site profile, tag adding
This commit is contained in:
parent
264e4becea
commit
d9b33238e9
10 changed files with 110 additions and 14 deletions
|
@ -13,7 +13,7 @@ class Event < Sequel::Model
|
|||
many_to_one :actioning_site, key: :actioning_site_id, class: :Site
|
||||
|
||||
def created_by?(site)
|
||||
return true if profile_comment && profile_comment.actioning_site_id == site.id
|
||||
return true if actioning_site_id == site.id
|
||||
false
|
||||
end
|
||||
|
||||
|
|
|
@ -279,12 +279,18 @@ class Site < Sequel::Model
|
|||
def after_save
|
||||
if @new_tag_strings
|
||||
@new_tag_strings.each do |new_tag_string|
|
||||
add_tag Tag[name: new_tag_string] || Tag.create(name: new_tag_string)
|
||||
add_tag_name new_tag_string
|
||||
end
|
||||
end
|
||||
super
|
||||
end
|
||||
|
||||
def add_tag_name(name)
|
||||
if tags_dataset.filter(name: name).first.nil?
|
||||
add_tag Tag[name: name] || Tag.create(name: name)
|
||||
end
|
||||
end
|
||||
|
||||
def after_create
|
||||
DB['update servers set slots_available=slots_available-1 where id=?', self.server.id].first
|
||||
super
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue