think this can be at least a tiny bit simpler:

```ruby
(defined?(Mongoid::Document) && user_klass.ancestors.include?(Mongoid::Document)
```