Sometimes when you have a belongs_to relations, you may notice, that getting an owner object can be really slow. Even if you add index like this: Mongoid might not catch it. Unfortunately you can’t just explain it, since this relation is returning an object not a Mongoid::Criteria. Luckily you can just hook up to your […]

Read more at the source