mongoid/mongoid — pull request #1979 by nfo (2012-05-04 14:41:03+00:00)
Title: Allow querying with multi-level inheritance

For example, with `C < B` and `B < A`, one can call not only `A.all` and `C.all`, but also `B.all`. This commit is not meant to be officially pulled, of course, as it changes the behavior around the :_type field (but it could still be retro-compatible), and it's just of dirty proof of concept.
I'd love to have some feedback on the concept, instead of the code.

```ruby
class A
include Mongoid::Document
end

class B < A
end

class C < B
end

C.create # => #]
A.all.to_a # => [#]
B.all.to_a # => [#]
C.all.to_a # => [#]
```