Skip to content
This repository
Browse code

mongoid 2.4.10 record ids wont serialize to json well using yajl. use…

… uglier but safer `id.to_s`
  • Loading branch information...
commit d0a52ef6c3ec5f7eb5d6f7ae6525d302005d694d 1 parent 5a45257
Marcelo Silveira authored
2  lib/devise/async/proxy.rb
@@ -11,7 +11,7 @@ def initialize(method, resource)
11 11 end
12 12
13 13 def deliver
14   - Worker.enqueue(@method, @resource.class.name, @resource.to_key)
  14 + Worker.enqueue(@method, @resource.class.name, @resource.id.to_s)
15 15 end
16 16 end
17 17 end
2  test/devise/async/proxy_test.rb
@@ -5,7 +5,7 @@ module Async
5 5 describe "Proxy" do
6 6 it "gets called by devise operations and proxy to worker" do
7 7 user = create_user
8   - Worker.expects(:enqueue).with(:confirmation_instructions, "User", [user.id])
  8 + Worker.expects(:enqueue).with(:confirmation_instructions, "User", user.id.to_s)
9 9 user.send_confirmation_instructions
10 10 end
11 11 end

0 comments on commit d0a52ef

Please sign in to comment.
Something went wrong with that request. Please try again.