-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 168 172 +4
=====================================
+ Hits 168 172 +4
Continue to review full report at Codecov.
|
include_examples 'an authorizing field', error | ||
context 'without policy' do | ||
let(:field) do | ||
subj = subject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - subj. Did you mean subject?
context 'without record' do | ||
context 'with policy' do | ||
let(:field) do | ||
subj = subject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - subj. Did you mean subject?
d2e9973
to
bb821d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows passing of keyword arguments to
authorize
, so a policy and a record can be overridden individually. Note that this is a breaking change. Where you previously usedto use
RepositoryPolicy#write?
, you now have to specify it like this:Also possible:
This would use the parent object in combination with the
RepositoryPolicy
, which was previously impossible (this is the main reason for the change).You can combine this with
record
like this:to instantiate the
RepositoryPolicy
withRepositoryCompound.new
and callwrite?
, which was also previously impossible.