FIX: missing site id lookup causing message bus cross talk in multisite

This commit is contained in:
Sam 2015-12-09 07:55:43 +11:00
parent 2cc95af69b
commit d8795a5345
1 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,10 @@
MessageBus.site_id_lookup do MessageBus.site_id_lookup do |env=nil|
RailsMultisite::ConnectionManagement.current_db if env
setup_message_bus_env(env)
env["__mb"][:site_id]
else
RailsMultisite::ConnectionManagement.current_db
end
end end
def setup_message_bus_env(env) def setup_message_bus_env(env)
@ -26,7 +31,8 @@ def setup_message_bus_env(env)
}, },
user_id: user_id, user_id: user_id,
group_ids: group_ids, group_ids: group_ids,
is_admin: is_admin is_admin: is_admin,
site_id: RailsMultisite::ConnectionManagement.current_db
} }
env["__mb"] = hash env["__mb"] = hash