spree/spree_auth_devise — pull request #124 by petergoldstein (2013-08-19 17:02:24+00:00)
Title: Support Asynchronous Mailers

As a general rule one shouldn't use anything but simple, easily serializable to JSON objects as arguments to Mailer methods. The reason for this is that in a system that runs mailers in asynchronous workers (e.g. Sidekiq, Resque) the arguments will be serialized to a data store and then unserialized by another process. So we wish to minimize the size of the data being stored in the data store, keep the serialization as simple as possible, and not use objects that are likely to be mangled during the serialization/de-serialization process.

With that in mind this PR:

1. Changes UserMailer#reset_password_instructions to handle the User object's id as an argument
2. Updates the User model to pass the user id rather than the User object itself
3. Supports the legacy behavior on UserMailer of passing a User object, in case 3rd party users of the framework are using this method directly
4. Updates the spec to reflect the new common case (passing an id) and adds a spec for the legacy case.