Closed movermeyer closed 2 years ago
LGTM, thank you @movermeyer for investigating this on a Sunday :)
The tests confirm it, but just to double check as well, I've used the repro app from #617 along with this new branch -- I can (double extra) confirm this branch fixes the issue.
What are you trying to accomplish?
Fixes #617. Alternative to #620.
591 was incorrect, since I didn't check/realize that
resolve
is called in three different cases:Symbol
(Code)defaults
are resolved. (Code)defaults
before falling back throughfallbacks
locales, keeping the behaviour as it has always been.Proc
(Code)1.
, where you are resolving a entry, but I mention it separately since it is being called from a different place in the code.Prior to #591, there was no distinction between the cases. #591 should have introduced that distinction.
What approach did you choose and why?
I added a
resolve_entry
method which can be overridden to handle the case of resolving an entry separately from resolvingdefaults
. By defaultresolve_entry
is an alias ofresolve
.I then changed the calls to
resolve
to useresolve_entry
in cases where they are resolving entries.What should reviewers focus on?
🤷
The impact of these changes
Fixes #617.
Testing
I added the regression test from #620 to show that it works with the existing Rails calls.