mirror of
https://github.com/neocities/neocities.git
synced 2025-07-20 09:36:00 +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
|
@ -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