-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
We get an error with the following code:
class Band include Mongoid::Document embeds_one :label end class Label include Mongoid::Document field :name, type: String embedded_in :band end label = Label.new(name: "Neil") b = Band.new(label: label) b.save! b.label = nil label.reload # error
This spawns the following error:
`reload': undefined method `empty?' for nil:NilClass (NoMethodError)
Which seems incorrect. I think an error should still be raised in this case, but a more appropriate one with a more descriptive message.
- related to
-
MONGOID-5206 Reloading retains stale changed value
- Closed
-
MONGOID-5235 Add Feature Flag: Reloading retains stale changed value
- Closed
-
MONGOID-5199 Reloadable#reload_embedded_document doesn't respect session
- Closed
-
MONGOID-5238 Add Feature Flag: Reloadable#reload_embedded_document doesn't respect session
- Closed