Method: ActiveRecord::InverseOfAssociationNotFoundError#corrections

Defined in:
activerecord/lib/active_record/associations/errors.rb

#correctionsObject



49
50
51
52
53
54
55
56
57
58
# File 'activerecord/lib/active_record/associations/errors.rb', line 49

def corrections
  if reflection && associated_class
    @corrections ||= begin
      maybe_these = associated_class.reflections.keys
      DidYouMean::SpellChecker.new(dictionary: maybe_these).correct(reflection.options[:inverse_of].to_s)
    end
  else
    []
  end
end