public
Created

Monkeypatch to make Devise::Mailer to work with Resque::Mailer

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require "devise"
 
module Devise
module Mailers
module Helpers
include Resque::Mailer
 
alias_method :old_initialize_from_record, :initialize_from_record
 
protected
def initialize_from_record(record)
ActiveRecord::Base.verify_active_connections! unless Rails.env.test?
record = User.find(record["id"]) if record.kind_of?(Hash)
old_initialize_from_record(record)
end
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.