class ActiveModel::Error
def match?(attribute, type = nil, **options)
See if error matches provided +attribute+, +type+, and +options+.
def match?(attribute, type = nil, **options) if @attribute != attribute || (type && @type != type) return false end options.each do |key, value| if @options[key] != value return false end end true end