Skip to content

Commit

Permalink
Preload searchkick import (#4697)
Browse files Browse the repository at this point in the history
Prevents N+1 during searchkick import
  • Loading branch information
nateberkopec committed May 12, 2024
1 parent 8fe8a29 commit 43ac749
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/concerns/rubygem_searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module RubygemSearchable
updated: { type: "date" }
}
}
scope :search_import, -> { includes(:linkset, :gem_download, :most_recent_version, :versions, :latest_version) }

def search_data # rubocop:disable Metrics/MethodLength
if (latest_version = most_recent_version)
Expand Down

0 comments on commit 43ac749

Please sign in to comment.