Conversation
Bumps the npm_and_yarn group with 1 update in the / directory: [@hotwired/turbo](https://github.com/hotwired/turbo). Updates `@hotwired/turbo` from 8.0.2 to 8.0.21 - [Release notes](https://github.com/hotwired/turbo/releases) - [Commits](hotwired/turbo@v8.0.2...v8.0.21) --- updated-dependencies: - dependency-name: "@hotwired/turbo" dependency-version: 8.0.21 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com>
…nd optimizing lodging cost retrieval to prevent N+1 queries
… for improved performance
…o ensure real ActiveRecord chain is used
…n to batch-load payment data, enhancing performance and preventing N+1 queries in the index view.
…ions by batch-loading payment data and lodging descriptions, improving performance and reducing query overhead.
…mized balance calculations, and update ActiveAdmin to utilize this method, enhancing performance and reducing query complexity.
…arn-555d475efb Bump @hotwired/turbo from 8.0.2 to 8.0.21 in the npm_and_yarn group across 1 directory
…r instance variables for improved clarity and maintainability.
There was a problem hiding this comment.
Pull request overview
This PR optimizes the admin applications index page by eliminating N+1 query problems when calculating balance due for multiple applications. The changes introduce a batch data loading strategy that preloads payment totals and lodging information, then uses a new model method to calculate balances without additional database queries.
Changes:
- Added
balance_due_with_batchmethod to the Application model for efficient balance calculations using preloaded data - Implemented controller-level batch data loading in admin applications and dashboard
- Added comprehensive test coverage for the new batch balance calculation method
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/models/application.rb | Added balance_due_with_batch method that calculates balance using preloaded payments and lodging data |
| app/admin/applications.rb | Implemented batch data loading in controller and updated index view to use new method, removed unused variable assignments |
| app/admin/dashboard.rb | Updated dashboard to use batch loading for balance calculations |
| spec/models/application_spec.rb | Added test coverage for balance_due_with_batch method including edge cases |
| spec/requests/admin_applications_spec.rb | Added request specs for admin applications index |
| spec/support/application_mock.rb | Added conditional skip for application mock to support new request tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ng partner_registration, ensuring data integrity and preventing incorrect balance calculations.
… the controller and improving code clarity.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rrors for missing lodging selections, improving data integrity and error handling in balance calculations.
No description provided.