charlotte-ruby/impressionist — pull request #46 by jgwmaxwell (2012-07-11 02:05:24+00:00)
Title: Mongoid Support

Hi there,

I've written a patch for Mongoid support for Impressionist, selectable through the same setup as MongoMapper and AR, just choose
```ruby
config.orm = :mongoid
```
It doesn't change any of the existing API, although I've removed the legacy code marked for removal in v0.5 since there will be no legacy Mongoid applications - imho it didn't make any sense to include it. Also, since it's essentially a new feature, it is **only compatible with Mongoid 3.0+**, those who haven't moved over yet from older versions of Mongoid should really be looking to anyway - it's a big step forward.

I wasn't 100% sure on how best to integrate the tests, so haven't included my own specs in the repo as I didn't want to clash with your style - I'll study yours a little more and include appropriate versions tomorrow.

Hope this helps and is of interest to you, feel free to tear it apart!

Looking ahead, changing some of the counting code so it runs MapReduce might offer some advantages - especially when the collection gets very large, I'd be happy to write relevant code if wanted.

John.