-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Associations
-
Minor Change
require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'mongoid' end require 'tempfile' Tempfile.open(%w(config .yml)) do |f| uri = 'mongodb://mongo/test' f.write(<<~YAML) development: clients: default: uri: #{uri} YAML f.flush Mongoid.load!(f.path, 'development') Mongoid::Clients.clients.each do |_, client| client.logger.level = Logger::ERROR end end class Parent include Mongoid::Document has_one :child end class Child include Mongoid::Document end Parent.new.child = Child.new __END__ Traceback (most recent call last): 7: from hi.rb:38:in `<main>' 6: from /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/accessors.rb:290:in `block (2 levels) in define_setter!' 5: from /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/accessors.rb:183:in `without_autobuild' 4: from /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/accessors.rb:299:in `block (3 levels) in define_setter!' 3: from /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/accessors.rb:30:in `__build__' 2: from /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/accessors.rb:50:in `create_relation' 1: from /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/referenced/has_one/buildable.rb:30:in `build' /usr/local/bundle/gems/mongoid-7.1.2/lib/mongoid/association/referenced/has_one/buildable.rb:38:in `clear_associated': nil is not a symbol nor a string (TypeError)
Is this intentional?