Skip to content
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

Convert params.permit to params.expect #5357

Merged
merged 5 commits into from
Dec 22, 2024
Merged

Conversation

martinemde
Copy link
Member

Yay! 😀

Use params[:id] for params in path
Copy link

codecov bot commented Dec 21, 2024

Codecov Report

Attention: Patch coverage is 98.18182% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.14%. Comparing base (03c1225) to head (04118ed).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
app/controllers/api_keys_controller.rb 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5357   +/-   ##
=======================================
  Coverage   97.14%   97.14%           
=======================================
  Files         458      458           
  Lines        9584     9584           
=======================================
  Hits         9310     9310           
  Misses        274      274           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

statements_attributes: [[
:effect,
principal: :oidc,
conditions_attributes: [%i[operator claim value]]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @segiddins this line doesn't fail any tests either way, but it looks like this is how the code works. I guess we don't pass conditions in a test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible

@@ -39,7 +39,7 @@ def in_audited_transaction(auditable:, admin_github_user:, action:, fields:, arg
changes = merge_changes!(changes, record.attributes.slice("id").transform_values { [_1, _1] }) if changes.key?("id")
changes = merge_changes!(changes, record.attributes.compact.transform_values { [_1, nil] }) if record.destroyed?

[key, { changes:, unchanged: record.attributes.except(*changes.keys) }]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubocop side-effect. Not related to this change but necessary to keep lint passing (while also improving how expect syntax is used)

@martinemde martinemde merged commit 0281c04 into master Dec 22, 2024
19 checks passed
@martinemde martinemde deleted the martinemde/param-expect branch December 22, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants