method

corrections

rails latest stable - Class: ActiveRecord::AssociationNotFoundError::Correction

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.1.7.7) is shown here.

corrections()
public

No documentation available.

# File activerecord/lib/active_record/associations.rb, line 24
      def corrections
        if @error.association_name
          maybe_these = @error.record.class.reflections.keys

          maybe_these.sort_by { |n|
            DidYouMean::Jaro.distance(@error.association_name.to_s, n)
          }.reverse.first(4)
        else
          []
        end
      end