instance method
match?
Ruby on Rails 6.1.7.10
Since v6.1.7.10Signature
match?(attribute, type = nil, **options)
See if error matches provided attribute, type and options.
Omitted params are not checked for a match.
Parameters
-
attributereq -
typeopt = nil -
optionskeyrest
Source
# File activemodel/lib/active_model/error.rb, line 165
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
Defined in activemodel/lib/active_model/error.rb line 165
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Error