-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: 9.0.7
-
Component/s: None
-
None
-
🔵 Done
-
Ruby Drivers
-
None
-
None
-
None
-
None
-
None
-
None
After upgrading Mongoid to 9, I'm intermittently getting the following exception:
undefined method 'model_for' for nil
when accessing a polymorphic relation. It seems the problem is [here](https://github.com/jamis/mongoid/blob/7a8ffbb06cd3349de95decca824327975cbe40f4/lib/mongoid/association/accessors.rb#L46) and it's extremely difficult to reproduce it (I only managed locally once, after adding debug output to mongoid gem and restarting the server, couldn't reproduce it again yet).
Maybe something with the mutex-instantiating the resolver?