Convert Photos controller to avoid elasticsearch#4675
Conversation
- Refactored `PhotosController#index` to use ActiveRecord queries instead of Searchkick/Elasticsearch. - Handled filtering by crop and planting via associations. - Added eager loading for the photo owner to prevent N+1 queries. - Decoupled the `Photo` model from Elasticsearch by removing the `SearchPhotos` concern. - Deleted `app/models/concerns/search_photos.rb`. - Updated controller and model specs to use standard ActiveRecord expectations. - Cleaned up the photo factory by removing the now-obsolete `:reindex` trait. Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Converted the Photos controller and model from using Elasticsearch (via Searchkick) to plain SQL queries using ActiveRecord. This includes refactoring the
indexaction to use model associations for filtering, adding eager loading for performance, and removing theSearchPhotosconcern and its corresponding file. Tests have been updated to reflect these changes and have been verified to pass.PR created automatically by Jules for task 4865766049333411151 started by @CloCkWeRX