Class: Devise::Async::Backend::SuckerPunch

Inherits:
Base
  • Object
show all
Includes:
SuckerPunch::Job
Defined in:
lib/devise/async/backend/sucker_punch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enqueue(*args) ⇒ Object



9
10
11
# File 'lib/devise/async/backend/sucker_punch.rb', line 9

def self.enqueue(*args)
  new.async.perform(*args)
end

Instance Method Details

#perform(method, resource_class, resource_id, *args) ⇒ Object

Return the connection to the pool after we’re done with it see: github.com/brandonhilkert/sucker_punch#usage



15
16
17
18
19
# File 'lib/devise/async/backend/sucker_punch.rb', line 15

def perform(method, resource_class, resource_id, *args)
  ActiveRecord::Base.connection_pool.with_connection do
    super
  end
end