{"record":{"id":"b89bf408e57e38cb","repo":"mongodb/mongoid","slug":"attempted-to-set-a-value-for-name-which-is-no","errorCode":null,"errorMessage":"Attempted to set a value for '%{name}' which is not allowed on the model %{klass}.","messagePattern":"Attempted to set a value for '%(.+?)' which is not allowed on the model %(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::UnknownAttribute","httpStatus":null,"severity":"error","filePath":"lib/mongoid/attributes/processing.rb","lineNumber":120,"sourceCode":"      # @return [ Hash ] The pending nested attributes in key/value pairs.\n      def pending_nested\n        @pending_nested ||= {}\n      end\n\n      # If the attribute is dynamic, add a field for it with a type of object\n      # and then either way set the value.\n      #\n      # @example Process the attribute.\n      #   document.process_attribute(name, value)\n      #\n      # @param [ Symbol ] name The name of the field.\n      # @param [ Object ] value The value of the field.\n      def process_attribute(name, value)\n        if !respond_to?(\"#{name}=\", true) && (store_as = aliased_fields.invert[name.to_s])\n          name = store_as\n        end\n        responds = respond_to?(\"#{name}=\", true)\n        raise Errors::UnknownAttribute.new(self.class, name) unless responds\n\n        send(\"#{name}=\", value)\n      end\n\n      # Process all the pending nested attributes that needed to wait until\n      # ids were set to fire off.\n      #\n      # @example Process the nested attributes.\n      #   document.process_nested\n      def process_nested\n        pending_nested.each_pair do |name, value|\n          send(\"#{name}=\", value)\n        end\n      end\n\n      # Process all the pending items, then clear them out.\n      #\n      # @example Process the pending items.","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/attributes/processing.rb#L102-L138","documentation":"Error \"Attempted to set a value for '%{name}' which is not allowed on the model %{klass}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/attributes/processing.rb:120 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"}