Improve query performance with includes and add comprehensive performance tests

- Replace left_joins with includes in auto-join queries for better performance
- Remove complex after_initialize callback since includes handles association loading
- Add automatic includes to find method for consistent behavior
- Add comprehensive performance tests with query counting
- Fix Sorbet type checking by adding ActiveSupport::Notifications to todo.rbi

Performance improvements:
- where() queries now use single query with includes
- N+1 queries avoided for multiple record loading
- All query methods (find, find_by, where) now optimized
This commit is contained in:
Dylan Knutson
2025-07-13 06:17:00 +00:00
parent fc6fd71e60
commit 4f41b66f85
3 changed files with 231 additions and 24 deletions

View File

@@ -13,6 +13,7 @@ module ActiveRecord::Rollback; end
module ActiveRecord::StatementInvalid; end
module ActiveSupport::ArrayInquirer; end
module ActiveSupport::Multibyte::Chars; end
module ActiveSupport::Notifications; end
module ActiveSupport::SafeBuffer; end
module ActiveSupport::StringInquirer; end
module ActiveSupport::TimeZone; end