module Apartment::ActiveJob

Constants

VERSION

Public Class Methods

new(*arguments) click to toggle source
Calls superclass method
# File lib/apartment/active_job.rb, line 13
def initialize(*arguments)
  @tenant = Apartment::Tenant.current
  super(*arguments)
end

Public Instance Methods

enqueue(*arguments) click to toggle source
Calls superclass method
# File lib/apartment/active_job.rb, line 18
def enqueue(*arguments)
  Apartment::Tenant.switch('public') do
    super(*arguments)
  end
end
execute(job_data) click to toggle source
Calls superclass method
# File lib/apartment/active_job.rb, line 6
def execute(job_data)
  Apartment::Tenant.switch(job_data['tenant']) do
    super
  end
end
serialize() click to toggle source
Calls superclass method
# File lib/apartment/active_job.rb, line 24
def serialize
  super.merge('tenant' => @tenant)
end