Module: Apartment::ActiveJob

Extended by:
ActiveSupport::Concern
Defined in:
lib/apartment/active_job.rb,
lib/apartment/active_job/version.rb

Constant Summary collapse

VERSION =
"1.0.0"

Instance Method Summary collapse

Instance Method Details

#enqueue(*arguments) ⇒ Object



18
19
20
21
22
# File 'lib/apartment/active_job.rb', line 18

def enqueue(*arguments)
  Apartment::Tenant.switch('public') do
    super(*arguments)
  end
end

#initialize(*arguments) ⇒ Object



13
14
15
16
# File 'lib/apartment/active_job.rb', line 13

def initialize(*arguments)
  @tenant = Apartment::Tenant.current
  super(*arguments)
end

#serializeObject



24
25
26
# File 'lib/apartment/active_job.rb', line 24

def serialize
  super.merge('tenant' => @tenant)
end