-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Associations
-
None
(Originally reported at https://github.com/mongodb/mongoid/discussions/5724)
class HtmlContent include Mongoid::Document has_one :user, class_name: 'User', inverse_of: :html_content, validate: false, dependent: :nullify end class User include Mongoid::Document belongs_to :html_content, class_name: 'HtmlContent', inverse_of: :user, dependent: :destroy, validate: false, optional: true end user = User.create! html_content = HtmlContent.create!(user: user) html_content.destroy! # /lib/mongoid/association/depending.rb:110:in `_dependent_nullify!' # Raises an error: # NoMethodError: undefined method `nullify' for #<User _id: 640084c257f2fc7f67cf1862 # # relation.nullify # ^^^^^^^^ # /lib/mongoid/association/depending.rb:110:in `_dependent_nullify!'
mongoid-7.5.3
- links to