-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Associations
-
None
Please see https://github.com/mongodb/mongoid/pull/5202 for a demonstration of these issues and further commentary.
- Embedded associations with touch: false will incorrectly touch the parent when touching the child:
class Hospital include Mongoid::Document include Mongoid::Timestamps embeds_many :floors, inverse_of: :hospital end class Floor include Mongoid::Document include Mongoid::Timestamps embedded_in :hospital, touch: false end building = Hospital.create! floor = building.floors.create! floor.touch building.updated_at # it is later than it should be
I have put up a PR which I believe illustrates these issues a little more clearly: https://github.com/mongodb/mongoid/pull/5204
- duplicates
-
MONGOID-5016 Change the default of :touch option to true on embedded associations
- Closed
- is caused by
-
MONGOID-5275 Embedded Associations inside submodules cannot find inverses
- Closed
- is related to
-
MONGOID-5016 Change the default of :touch option to true on embedded associations
- Closed