Replies: 2 comments 1 reply
-
Hi @idbentley ,
Mongoid does currently deviate from both Ruby and Rails behavior with respect to how it resolves association class names. This is described in detail here. The current implementation in Mongoid offers better diagnostics in some cases but is problematic in others. We are planning to change Mongoid to match Ruby and Rails behavior. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been working with Mongoid in Ruby on Rails for a week or two. I have some experience with Rails, RoR and MongoDB independently, but this is the first time working with them together.
In the end this has been a frustrating experience because of the cryptic error messages that this library throws when using embedded models.
Specifically I'm referring to the error messages of the form:
NameError: uninitialized constant EmbeddingModel::EmbeddedModel
I'm hardly the first one to encounter this (for example: https://www.jamesridgway.co.uk/debugging-uninitialized-constant-issues-in-mongoid-active/).
There is no mention of this error in the docs, nor can I find any place where the fix of giving your
embeds_*
statement an explicit fully qualified class name anywhere in the docs.Is there a good reason that Mongoid can't give a less cryptic error message? Is there a reason this isn't documented?
Beta Was this translation helpful? Give feedback.
All reactions