36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/vert/rls/job_context.rb', line 36
def call(_worker, job, _queue)
context = job.delete("__vert_context__")
if context
Vert::Current.deserialize(context)
Vert::Rls::ConnectionHandler.set_context(tenant_id: Vert::Current.tenant_id, company_id: Vert::Current.company_id, user_id: Vert::Current.user_id) if Vert.config.enable_rls && Vert::Current.tenant_id.present?
end
yield
ensure
Vert::Current.reset_all
Vert::Rls::ConnectionHandler.reset_context if Vert.config.enable_rls
end
|