{"record":{"id":"758fdd5e676cb124","repo":"mongodb/mongoid","slug":"invalid-dependent-strategy-invalid-strategy","errorCode":null,"errorMessage":"Invalid dependent strategy: %{invalid_strategy}.","messagePattern":"Invalid dependent strategy: %(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::InvalidDependentStrategy","httpStatus":null,"severity":"error","filePath":"lib/mongoid/association/depending.rb","lineNumber":78,"sourceCode":"            klass.dependents_owner = klass\n          end\n\n          klass.dependents.push(association) if association.dependent && !klass.dependents.include?(association)\n        end\n      end\n\n      # Validates that an association's dependent strategy is\n      # within the allowed enumeration.\n      #\n      # @param [ Mongoid::Association::Relatable ] association\n      #   The association to validate.\n      #\n      # @raises [ Mongoid::Errors::InvalidDependentStrategy ]\n      #   Error if invalid.\n      def self.validate!(association)\n        return if STRATEGIES.include?(association.dependent)\n\n        raise Errors::InvalidDependentStrategy.new(association,\n                                                   association.dependent,\n                                                   STRATEGIES)\n      end\n\n      # Perform all cascading deletes, destroys, or nullifies. Will delegate to\n      # the appropriate strategy to perform the operation.\n      #\n      # @example Execute cascades.\n      #   document.apply_destroy_dependencies!\n      def apply_destroy_dependencies!\n        self.class._all_dependents.each do |association|\n          if dependent = association.try(:dependent)\n            send(\"_dependent_#{dependent}!\", association)\n          end\n        end\n      end\n\n      private","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/association/depending.rb#L60-L96","documentation":"Error \"Invalid dependent strategy: %{invalid_strategy}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/association/depending.rb:78 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"}