未验证 提交 6a4eb3e7 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #36061 from shioyama/update_comment

Update comment in attribute_method_matchers_matching
......@@ -352,8 +352,9 @@ def attribute_method_matchers_cache
def attribute_method_matchers_matching(method_name)
attribute_method_matchers_cache.compute_if_absent(method_name) do
# Must try to match prefixes/suffixes first, or else the matcher with no prefix/suffix
# will match every time.
# Bump plain matcher to last place so that only methods that do not
# match any other pattern match the actual attribute name.
# This is currently only needed to support legacy usage.
matchers = attribute_method_matchers.partition(&:plain?).reverse.flatten(1)
matchers.map { |matcher| matcher.match(method_name) }.compact
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册