diff options
author | Chris Salzberg <chris@dejimata.com> | 2019-04-17 21:08:11 +0900 |
---|---|---|
committer | Chris Salzberg <chris@dejimata.com> | 2019-05-31 12:55:59 +0900 |
commit | dd0357aeb85b6466dea97800c9f45cb6080f1324 (patch) | |
tree | 4c5820da03e35048ea6b7c906358d02ebeb817dc /activesupport/lib/active_support/dependencies/autoload.rb | |
parent | 5ce1f66d7ac50492f4cd1e6bd0170b2c888ec73d (diff) | |
download | rails-dd0357aeb85b6466dea97800c9f45cb6080f1324.tar.gz rails-dd0357aeb85b6466dea97800c9f45cb6080f1324.tar.bz2 rails-dd0357aeb85b6466dea97800c9f45cb6080f1324.zip |
Make plain matcher match first, not last
This code takes the "plain" matcher with no prefix and suffix and puts
it at the end of the matchers array such that it is de-prioritized among
all matchers. The comment explaining this code, originally from commimt
8b8b7143efe dated in 2011, is in a context where detection from matchers
happened immediately. In that situation, the plain matcher would indeed
always match first and no others would ever be used.
However, the current code does not immediately detect one match but
rather maps matchers to matches for the method_name. Detection only
happens for matches whose attribute name is valid.
In this context, there is no need to bump the plain matcher to the end
of the array, since it will only be selected if the attribute name it
catpures matches a valid attribute name.
Diffstat (limited to 'activesupport/lib/active_support/dependencies/autoload.rb')
0 files changed, 0 insertions, 0 deletions