-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
I noticed some changes in the way loading an instance with 'only' or 'without' behaves in beta 1. It now fortunately throws errors when a field is accessed which isn't loaded. But it also marks the object as read only preventing us from changing and then saving the object.
Is this really what you want to do? A pretty common use case scenario is that documents are relatively big and you only need to change a couple of fields; querying just those fields, making modifications and then saving the object used to work great.
Would it not be better to just throw errors when trying to access or save unloaded fields?
- is duplicated by
-
MONGOID-4194 Restore support on saving `only` loaded documents
- Closed
- is related to
-
MONGOID-4455 Make readonly attributes behavior consistent with ActiveRecord
- Closed
- related to
-
MONGOID-5474 Raise Mongoid::Errors::ReadonlyDocument when saving readonly documents
- Closed