method

check_dependent_options

rails latest stable - Class: ActiveRecord::Associations::Builder::Association
check_dependent_options(dependent, model)
private

No documentation available.

# File activerecord/lib/active_record/associations/builder/association.rb, line 129
    def self.check_dependent_options(dependent, model)
      if dependent == :destroy_async && !model.destroy_association_async_job
        err_message = "A valid destroy_association_async_job is required to use `dependent: :destroy_async` on associations"
        raise ActiveRecord::ConfigurationError, err_message
      end
      unless valid_dependent_options.include? dependent
        raise ArgumentError, "The :dependent option must be one of #{valid_dependent_options}, but is :#{dependent}"
      end
    end