Skip to content

Commit d671983

Browse files
committed
Prevent raise error when load file with "..." under ruby 2.6
1 parent 00af2a2 commit d671983

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

lib/multi_tenant_support/active_job.rb

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ def perform_now(*args)
1515
job.perform_now
1616
end
1717
else
18-
def perform_now(...)
19-
job = job_or_instantiate(...)
20-
job.current_tenant = MultiTenantSupport.current_tenant
21-
job.perform_now
22-
end
18+
eval("
19+
def perform_now(...)
20+
job = job_or_instantiate(...)
21+
job.current_tenant = MultiTenantSupport.current_tenant
22+
job.perform_now
23+
end
24+
")
2325
end
2426
end
2527

@@ -69,11 +71,13 @@ def perform_now(*args)
6971
job.perform_now
7072
end
7173
else
72-
def perform_now(...)
73-
job = @job_class.new(...)
74-
job.current_tenant = MultiTenantSupport.current_tenant
75-
job.perform_now
76-
end
74+
eval("
75+
def perform_now(...)
76+
job = @job_class.new(...)
77+
job.current_tenant = MultiTenantSupport.current_tenant
78+
job.perform_now
79+
end
80+
")
7781
end
7882
end
7983
end

0 commit comments

Comments
 (0)