Skip to content

Commit ca73670

Browse files
authored
Merge pull request #360 from openstax/update_latest_only
Update slug tags only for the latest versions of each Exercise
2 parents 615ade1 + 094f79a commit ca73670

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)