mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:16:41 +08:00
add multisite support for the 'uploads:gather' rake task
This commit is contained in:
parent
eda6084d4b
commit
8e4113a468
|
@ -7,6 +7,14 @@ require "digest/sha1"
|
|||
task "uploads:gather" => :environment do
|
||||
require "db_helper"
|
||||
|
||||
ENV["RAILS_DB"] ? gather_uploads : gather_uploads_for_all_sites
|
||||
end
|
||||
|
||||
def gather_uploads_for_all_sites
|
||||
RailsMultisite::ConnectionManagement.each_connection { gather_uploads }
|
||||
end
|
||||
|
||||
def gather_uploads
|
||||
public_directory = "#{Rails.root}/public"
|
||||
current_db = RailsMultisite::ConnectionManagement.current_db
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user