-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Associations, Persistence
Related to https://jira.mongodb.org/browse/MONGOID-4734?filter=26864:
class Address include Mongoid::Document field :city, type: String embedded_in :addressable, polymorphic: true end class Company include Mongoid::Document embeds_one :address, class_name: 'Address', as: :addressable embeds_one :delivery_address, class_name: 'Address', as: :addressable end address = Address.new company = Company.create!(delivery_address: address, address: address) address.destroy company.reload
Both addresses should be nil, however only delivery_address is nullified.
This issue may be invalid because the address is only capable of referencing the company once, thus whether it is fixable depends on whether we traverse associations from embedded document to host document or from host one to embedded one.
- is related to
-
MONGOID-4734 Updating an association value to object instance when the instance has multiple inverses changes the wrong field
- Closed