The MongoID docs seem to be pretty clear that I should be able to run this and have it work:
Band.find_by(name: "Photek")
but at least with MongoID 2.4.11 this gives me a NoMethodError.
This, on the other hand, works:
Band.find(name: "Photek")
It’s easy enough to change find_by to find, but I’m confused what’s going on. Is this a case where my gem version is behind the docs, or what?
The Mongoid docs now show you version 3 by default (it’s an RC). You want to look at the docs here for Mongoid 2.
On
findvsfind_by, this is from the upgrade guide for Mongoid 2 -> 3:IOW:
Mongoid 2:
Mongoid 3: