Sha256: 3186a5b3c6cf82fcb3317dae4c7022f210d74466e5aabea45ffa7c83ff1a829e

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

module Devise
  module Async
    class Proxy
      # Catches all devise emails
      def self.method_missing(method, *args, &block)
        new(method, args.first)
      end

      def initialize(method, resource)
        @method, @resource = method, resource
      end

      def deliver
        # Use `id.to_s` to avoid problems with mongoid 2.4.X ids being serialized
        # wrong with YAJL.
        Worker.enqueue(@method, @resource.class.name, @resource.id.to_s)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-async-0.5.1 lib/devise/async/proxy.rb
devise-async-0.5.0 lib/devise/async/proxy.rb