{"record":{"id":"a2605260758d9300","repo":"mongodb/mongoid","slug":"having-a-root-path-assigned-for-klass-is-invali","errorCode":null,"errorMessage":"Having a root path assigned for %{klass} is invalid.","messagePattern":"Having a root path assigned for %(.+?) is invalid\\.","errorType":"exception","errorClass":"Mongoid::Errors::InvalidPath","httpStatus":null,"severity":"error","filePath":"lib/mongoid/atomic/paths/root.rb","lineNumber":29,"sourceCode":"        # Create the new root path utility.\n        #\n        # @example Create the root path util.\n        #   Root.new(document)\n        #\n        # @param [ Document ] document The document to generate the paths for.\n        def initialize(document)\n          @document, @path, @position = document, '', ''\n        end\n\n        # Asking for the insert modifier on a document with a root path\n        # indicates a mixed association most likely happened.\n        #\n        # @example Attempt to get the insert modifier.\n        #   root.insert_modifier\n        #\n        # @raise [ Errors::InvalidPath ] The error for the attempt.\n        def insert_modifier\n          raise Errors::InvalidPath.new(document.class)\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":11,"sourceCodeEnd":35,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/atomic/paths/root.rb#L11-L35","documentation":"Error \"Having a root path assigned for %{klass} is invalid.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/atomic/paths/root.rb:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}