Closed aaronskiba closed 5 months ago
1 Error | |
---|---|
:no_entry_sign: | Please include a CHANGELOG entry.
|
1 Warning | |
---|---|
:warning: | There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in behavior. \n Ignore this warning if the PR ONLY contains translation.io synced updates. |
Generated by :no_entry_sign: Danger
Closing this PR and will instead break it into smaller PRs.
Changes proposed in this PR:
.includes()
args have been added or removed to address these warnings..length
have been changed to.size
or.any?
to address these warnings (which are sometimes false-positives)..length
brings the records into memory..size
and.any?
will only operate on the memory level if the records are already in memory. Otherwise, they will operate on the db level.app/controllers/org_admin/templates_controller.rb
has been re-factored. In particular, the refactoring prevents N+1 queries related to the calls toTemplate.published
.The following table compares the
development
branch toaaron/bullet-fixes
by making requests to the various paths affected by this PR. The benchmarking was performed via ab - Apache HTTP server benchmarking tool alongside a recent (May 2024) db dump from the production environment of DMP Assistant. In both cases, 100 consecutive requests were performed to each path and the recorded result is the mean request time (ms).Example request: