Loading
Release 2.2.0
Diff
Checklist
- Change the
VERSIONconstant to a minor version inlib/declarative_policy/version.rb(you might have to change the version number in the next steps according to SemVer). - Ensure the diff link above is up-to-date.
- Add release notes to the Changelog section below.
- Based on the diff and the release notes, update the
version.rbaccording to SemVer. - Run
bundle installto updateGemfile.lock
Changelog
The generated changelog only includes !85 (merged). The squash commit for !86 (merged) and the commit for !87 (merged) have no Changelog: trailer, so I added their entries by hand.
Fixed (1 change)
- Iterate runner values when invalidating cached policies (merge request):
DeclarativePolicy.invalidateno longer raisesNoMethodErrorwhen a cached policy has runners.
Changed (4 changes)
- Return a frozen empty array for abilities with no rules (merge request)
- IMPORTANT:
configuration_fornow returns a frozen array that is shared between calls. Code that appends to the result raisesFrozenError. (merge request) Runner::State#called_conditionsnow returns a newSeton each call. (merge request)- Added
Base#user_cache_keyandBase#subject_cache_key, two new public methods. (merge request)
Performance (2 changes)
- Cache each policy class's combined declarations (merge request)
- Cut the per-check cost of running a policy (merge request): caches each ability's combined rules, builds condition cache keys once per policy, and tracks runner dependencies by cache key.
Edited by Ian Anderson