Skip to content

Commit ee5616f

Browse files
committed
Select only the Exercises' ids for UpdateSlugs
1 parent 14936ba commit ee5616f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/routines/update_slugs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class UpdateSlugs
66
def exec
77
Exercise.preload(:publication).in_batches(of: 100, load: true) do |exercises|
88
Exercise.transaction do
9-
updated_exercise_ids = exercises.filter(&:set_slug_tags!).map(&:id)
9+
updated_exercise_ids = exercises.select(:id).filter(&:set_slug_tags!).map(&:id)
1010
next if updated_exercise_ids.empty?
1111

1212
Exercise.where(id: updated_exercise_ids).update_all updated_at: Time.current

0 commit comments

Comments
 (0)