Skip to content

Commit 094f79a

Browse files
committed
Update slug tags only for the latest versions of each Exercise
1 parent ee5616f commit 094f79a

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
@@ -4,7 +4,7 @@ class UpdateSlugs
44
protected
55

66
def exec
7-
Exercise.preload(:publication).in_batches(of: 100, load: true) do |exercises|
7+
Exercise.chainable_latest.preload(:publication).in_batches(of: 100, load: true) do |exercises|
88
Exercise.transaction do
99
updated_exercise_ids = exercises.select(:id).filter(&:set_slug_tags!).map(&:id)
1010
next if updated_exercise_ids.empty?

0 commit comments

Comments
 (0)