I've implemented the fix suggested by jferris. I didn't modify the specs because 1) I'm not that familiar with RSpec's mocks and 2) I have limited time at the moment to figure out a good way to test the changes. I know that might sound like a cop-out but unfortunately it's the truth right now. If you require the specs to reflect the new changes before you will accept the pull request, it will be some time later before I can get to it. I've tested the changes locally and it does in fact work. Since this code is simply copied from jferris's example combined with the fact that I've verified that the code does work, it's relatively safe to assume the code is in good shape.
I've implemented the fix suggested by jferris. I didn't modify the specs because 1) I'm not that familiar with RSpec's mocks and 2) I have limited time at the moment to figure out a good way to test the changes. I know that might sound like a cop-out but unfortunately it's the truth right now. If you require the specs to reflect the new changes before you will accept the pull request, it will be some time later before I can get to it. I've tested the changes locally and it does in fact work. Since this code is simply copied from jferris's example combined with the fact that I've verified that the code does work, it's relatively safe to assume the code is in good shape.