forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deprecation path for arity-zero preference defaults
Solidus 3.1 shipped with a new preferences system, where a default can take different values depending on the Solidus version defaults that have been loaded. See solidusio#4064 for details. To achieve those above, when a proc is given as the default value constructor, it now should take the loaded Solidus version as an argument. That's a breaking change, as some extensions or user-defined preferences may be using zero-arity lambdas. This commit deprecates zero-arity lambdas but wraps them into another lambda, taking and disregarding a single argument. That's only needed for procs with lambda semantics, as raw procs will ignore the provided extra argument. When it comes to the implementation, as it's something to be ditched in the next major release, we've opted for the more straightforward solution. I.e., wrapping the lambda into the `Preferable` module even if it only affects `AppConfiguration` classes. The default-handling logic is very entangled into the former, and it'd take more work to extract it. Fixes solidusio#4165
- Loading branch information
1 parent
18762f7
commit 2efe065
Showing
2 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters