mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 11:58:28 +02:00
move changed count and screenshot logic to model
This commit is contained in:
parent
e01a74421a
commit
a5df2c86cd
2 changed files with 14 additions and 7 deletions
|
@ -128,6 +128,18 @@ class Site < Sequel::Model
|
|||
def store_file(filename, uploaded)
|
||||
FileUtils.mv uploaded.path, file_path(filename)
|
||||
File.chmod(0640, file_path(filename))
|
||||
|
||||
if filename =~ /index\.html/
|
||||
ScreenshotWorker.perform_async values[:username]
|
||||
self.site_changed = true
|
||||
save(validate: false)
|
||||
end
|
||||
end
|
||||
|
||||
def increment_changed_count
|
||||
self.changed_count += 1
|
||||
self.updated_at = Time.now
|
||||
save(validate: false)
|
||||
end
|
||||
|
||||
def files_zip
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue