Methods
Class Public methods
new(error)
📝 Source code
# File activerecord/lib/active_record/associations.rb, line 93
def initialize(error)
@error = error
end
🔎 See on GitHub
Instance Public methods
corrections()
📝 Source code
# File activerecord/lib/active_record/associations.rb, line 97
def corrections
if @error.reflection && @error.owner_class
maybe_these = @error.owner_class.reflections.keys
maybe_these -= [@error.reflection.name.to_s] # remove failing reflection
maybe_these.sort_by { |n|
DidYouMean::Jaro.distance(@error.reflection.options[:through].to_s, n)
}.reverse.first(4)
else
[]
end
end
🔎 See on GitHub