Permalink
Browse files

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

… uglier but safer `id.to_s`
  • Loading branch information...
1 parent 5a45257 commit d0a52ef6c3ec5f7eb5d6f7ae6525d302005d694d @mhfs committed May 31, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/devise/async/proxy.rb
  2. +1 −1 test/devise/async/proxy_test.rb
@@ -11,7 +11,7 @@ def initialize(method, resource)
end
def deliver
- Worker.enqueue(@method, @resource.class.name, @resource.to_key)
+ Worker.enqueue(@method, @resource.class.name, @resource.id.to_s)
end
end
end
@@ -5,7 +5,7 @@ module Async
describe "Proxy" do
it "gets called by devise operations and proxy to worker" do
user = create_user
- Worker.expects(:enqueue).with(:confirmation_instructions, "User", [user.id])
+ Worker.expects(:enqueue).with(:confirmation_instructions, "User", user.id.to_s)
user.send_confirmation_instructions
end
end

0 comments on commit d0a52ef

Please sign in to comment.