Reset current_user_id before execute backends.

This commit is contained in:
Martin Edenhofer 2016-04-26 08:02:10 +02:00
parent 54a41212df
commit af3087abea
2 changed files with 1 additions and 2 deletions

View file

@ -24,6 +24,7 @@ class Transaction::BackgroundJob
Setting.where(area: 'Transaction::Backend').order(:name).each {|setting|
backend = Setting.get(setting.name)
begin
UserInfo.current_user_id = 1
integration = Kernel.const_get(backend).new(@item, @params)
integration.perform
rescue => e

View file

@ -162,8 +162,6 @@ class Transaction::ClearbitEnrichment
if !organization
organization = Organization.new(
shared: config['organization_shared'],
updated_by_id: 1,
created_by_id: 1,
)
organization_sync_values.each {|destination, value|
attribute = destination.sub(/^organization\./, '')