mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Merge branch 'master' of github.com:kyledrake/neocities-web
This commit is contained in:
commit
6d345ddc5f
2 changed files with 13 additions and 2 deletions
4
app.rb
4
app.rb
|
@ -279,7 +279,7 @@ post '/site_files/upload' do
|
|||
current_site.update site_changed: true
|
||||
end
|
||||
|
||||
current_site.update updated_at: Time.now
|
||||
current_site.update changed_count: 1+current_site.changed_count, updated_at: Time.now
|
||||
|
||||
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
|
||||
redirect '/dashboard'
|
||||
|
@ -349,7 +349,7 @@ post '/site_files/save/:filename' do |filename|
|
|||
current_site.update site_changed: true
|
||||
end
|
||||
|
||||
current_site.update updated_at: Time.now
|
||||
current_site.update changed_count: 1+current_site.changed_count, updated_at: Time.now
|
||||
|
||||
'ok'
|
||||
end
|
||||
|
|
11
migrations/016_site_updated_count.rb
Normal file
11
migrations/016_site_updated_count.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
Sequel.migration do
|
||||
up {
|
||||
DB.add_column :sites, :changed_count, :integer, default: 0
|
||||
DB.add_index :sites, :changed_count
|
||||
}
|
||||
|
||||
down {
|
||||
DB.drop_column :sites, :changed_count
|
||||
DB.drop_index :sites, :changed_count
|
||||
}
|
||||
end
|
Loading…
Add table
Reference in a new issue