Change upgrade copy, initial site files prime code

This commit is contained in:
Kyle Drake 2015-08-05 11:39:46 -07:00
parent ac9ca39bfe
commit 6e0b21bfd2
2 changed files with 26 additions and 4 deletions

View file

@ -216,6 +216,30 @@ task :hash_ips => [:environment] do
end end
end end
desc 'prime_site_files'
task :prime_site_files => [:environment] do
Site.where(is_banned: false).select(:id, :username).all.each do |site|
Dir.glob(File.join(site.files_path, '**/*')).each do |file|
next unless site.username == 'kyledrake'
path = file.gsub(site.base_files_path, '').sub(/^\//, '')
site_file = site.site_files_dataset[path: path]
if site_file.nil?
next if File.directory? file
mtime = File.mtime file
site.add_site_file(
path: path,
size: File.size(file),
sha1_hash: Digest::SHA1.file(file).hexdigest,
updated_at: mtime,
created_at: mtime
)
end
end
end
end
=begin =begin
desc 'Update screenshots' desc 'Update screenshots'
task :update_screenshots => [:environment] do task :update_screenshots => [:environment] do

View file

@ -1,8 +1,6 @@
Hi there! Hi there!
A Neocities administrator has upgraded your account to supporter! Someone at Neocities must really like you (or your site). :) A Neocities administrator has upgraded your account to supporter! You can see some of the new features you can use by visiting our supporter page at https://neocities.org/plan
We won't charge you for the upgrade, so no worries on that. You can see some of the new features you can use by visiting our supporter page at https://neocities.org/plan
We're looking forward to seeing the awesome things you will do with it. We're looking forward to seeing the awesome things you will do with it.
@ -12,4 +10,4 @@ If you have any questions or comments, or just want to say hi, feel free to cont
From Penelope (the Neocities' cat/sysadmin), everyone that's helped work on Neocities, and on behalf of all our sites, our very best wishes for you (and your awesome web site). From Penelope (the Neocities' cat/sysadmin), everyone that's helped work on Neocities, and on behalf of all our sites, our very best wishes for you (and your awesome web site).
- The Neocities Team - The Neocities Team