-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass 'model_instance' as 'model:' into custom masker's Proc #58
Conversation
spec/features/shared_examples.rb
Outdated
expect { run_rake_task }.not_to(change { User.count }) | ||
|
||
expect { han.reload }.to( | ||
change { han.first_name }.to("naHhan@example.test") & |
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.
Indent the first parameter one step more than the start of the previous line.
@@ -34,7 +34,7 @@ def should_mask?(model_instance) | |||
# returning. | |||
def mask(model_instance) | |||
value = unmarshal_data(model_instance.send(name)) | |||
masker_value = options[:masker].call(options.merge!(value: value)) | |||
masker_value = options[:masker].call(options.merge!(value: value, model: model_instance)) |
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.
Line is too long. [95/80]
LGTM! |
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
==========================================
- Coverage 99.4% 99.39% -0.01%
==========================================
Files 23 23
Lines 334 332 -2
==========================================
- Hits 332 330 -2
Misses 2 2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
==========================================
- Coverage 99.4% 99.39% -0.01%
==========================================
Files 23 23
Lines 334 333 -1
==========================================
- Hits 332 331 -1
Misses 2 2
Continue to review full report at Codecov.
|
d873ba8
to
b3d00cf
Compare
Thanks @ribose-jeffreylau ! |
This allows for something like this:
Ref #5