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

Add Account.auditable scope, fix N+1 in admin/action_logs#index #28812

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

mjankowski
Copy link
Contributor

Main change -- add an auditable scope to Account which finds (distinct) accounts that have Admin::ActionLog records.

While reviewing queries from usage here, I noticed an N+1 in the controller -- theres a loop of _action_log partial which call out to the account for each one. Added account to includes in the filter to fix the N+1 there.

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5ae3bae) 85.07% compared to head (abd9dd5) 85.07%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #28812   +/-   ##
=======================================
  Coverage   85.07%   85.07%           
=======================================
  Files        1038     1038           
  Lines       28123    28124    +1     
  Branches     4530     4530           
=======================================
+ Hits        23926    23927    +1     
  Misses       3038     3038           
  Partials     1159     1159           

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

@Gargron Gargron added this pull request to the merge queue Jan 19, 2024
Merged via the queue into mastodon:main with commit 1480573 Jan 19, 2024
28 checks passed
@mjankowski mjankowski deleted the account-auditable branch January 19, 2024 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants