method

guard

rails latest stable - Class: ActiveRecord::Associations::Deprecation

Method not available on this version

This method is only available on newer versions. The first available version (v8.1.1) is shown here.

guard(reflection)
public

No documentation available.

# File activerecord/lib/active_record/associations/deprecation.rb, line 28
    def guard(reflection)
      report(reflection, context: yield) if reflection.deprecated?

      if reflection.through_reflection?
        reflection.deprecated_nested_reflections.each do |deprecated_nested_reflection|
          context = "referenced as nested association of the through #{reflection.active_record}##{reflection.name}"
          report(deprecated_nested_reflection, context: context)
        end
      end
    end