mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: attachments bust under multisite
This commit is contained in:
@@ -35,12 +35,15 @@ module RailsMultisite
|
||||
old = current_db
|
||||
connected = ActiveRecord::Base.connection_pool.connected?
|
||||
|
||||
establish_connection(:db => db)
|
||||
establish_connection(:db => db) unless connected && db == old
|
||||
rval = yield db
|
||||
ActiveRecord::Base.connection_handler.clear_active_connections!
|
||||
|
||||
establish_connection(:db => old)
|
||||
ActiveRecord::Base.connection_handler.clear_active_connections! unless connected
|
||||
unless connected && db == old
|
||||
ActiveRecord::Base.connection_handler.clear_active_connections!
|
||||
|
||||
establish_connection(:db => old)
|
||||
ActiveRecord::Base.connection_handler.clear_active_connections! unless connected
|
||||
end
|
||||
|
||||
rval
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user