method

check_dependent_options

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: Association
check_dependent_options(dependent, model) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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 = "ActiveJob is required to use destroy_async on associations"
        raise ActiveRecord::ActiveJobRequiredError, 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
Register or log in to add new notes.