Loosen type check for Mongo::Collection#aggregate #174

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@kamarcum

Mongo::Collection#aggregate was doing a strict arg.class == Array and arg.class == Hash. I changed this to use is_a? to make it easier to pass arguments like HashWithIndifferentAccess, which shouldn't interfere with the functionality.

A simple test is included.

Thanks!

@brandonblack
Contributor

@kamarcum thanks for the contribution, but it looks like this broke a few tests in a few different versions of Ruby. Aside from the failures in Travis, make sure you've also validated your change with rake test:replica_set in 1.8.7, 1.9.3 and JRuby.

@kamarcum

Those two failures on Travis are pretty mysterious to me. Any hints?
I had only run rake test, and only with 1.9.3. I'll see if I can reproduce any of that locally.

@kamarcum

Well. I'm glad in a way that commit didn't make a difference in Travis. I couldn't think of a reason 1.8.7 would treat this code differently, so I guessed.

@brandonblack
Contributor

Looks like a few of those initial failures were not related to your change and just Travis weirdness (specifically JRuby). However, it's definitely still failing for for Ruby 1.8.x. I'd love to merge this change, and I think it's a great contribution but making it work for 1.8.x is a must before I can do so.

Let me know when you've had a chance to look at this build failure:
https://travis-ci.org/mongodb/mongo-ruby-driver/jobs/5448949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment