Skip to content

Instantly share code, notes, and snippets.

@cfcosta
Created August 21, 2012 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfcosta/3418640 to your computer and use it in GitHub Desktop.
Save cfcosta/3418640 to your computer and use it in GitHub Desktop.
Monkeypatch to make Devise::Mailer to work with Resque::Mailer
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment