Skip to content

Commit

Permalink
set org with actsastenant
Browse files Browse the repository at this point in the history
  • Loading branch information
jmilljr24 committed Dec 19, 2024
1 parent 20e2590 commit da64325
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create
file = params[:files]
@blob = ActiveStorage::Blob.create_and_upload!(io: file, filename: file.original_filename)

CsvImportJob.perform_later(@blob.signed_id, Current.organization.id, current_user.id)
CsvImportJob.perform_later(@blob.signed_id, current_user.id)

flash.now[:notice] = t(".processing_file")
respond_to do |format|
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/csv_import_job.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class CsvImportJob < ApplicationJob
queue_as :default

def perform(blob_signed_id, current_organization_id, current_user_id)
def perform(blob_signed_id, current_user_id)
blob = ActiveStorage::Blob.find_signed(blob_signed_id)

Organizations::Importers::CsvImportService.new(blob, current_organization_id, current_user_id).call
Organizations::Importers::CsvImportService.new(blob, current_user_id).call
ensure
blob.purge_later
end
Expand Down
4 changes: 2 additions & 2 deletions app/services/organizations/importers/csv_import_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module Organizations
module Importers
class CsvImportService
Status = Data.define(:success?, :count, :no_match, :errors)
def initialize(file, organization_id, current_user_id)
def initialize(file, current_user_id)
@file = file
@organization = Organization.find(organization_id)
@organization = ActsAsTenant.current_tenant
@current_user = User.find(current_user_id)
@count = 0
@no_match = []
Expand Down

0 comments on commit da64325

Please sign in to comment.