class ActiveRecord::Associations::Builder::Association
def configure_dependency
def configure_dependency unless valid_dependent_options.include? options[:dependent] raise ArgumentError, "The :dependent option must be one of #{valid_dependent_options}, but is :#{options[:dependent]}" end if options[:dependent] == :restrict ActiveSupport::Deprecation.warn( "The :restrict option is deprecated. Please use :restrict_with_exception instead, which " \ "provides the same functionality." ) end mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1 def #{macro}_dependent_for_#{name} association(:#{name}).handle_dependency end CODE model.before_destroy "#{macro}_dependent_for_#{name}" end