DEV: correct revision debouncer for backup draft

We were debouncing on update_at which we kept on pushing forward, this
was leading to not enough revisions.
This commit is contained in:
Sam Saffron
2019-10-17 17:41:28 +11:00
parent 3314aa9f88
commit cb0443792b
2 changed files with 6 additions and 2 deletions

View File

@ -137,7 +137,7 @@ class Draft < ActiveRecord::Base
).create
BackupDraftPost.create!(user_id: user.id, key: key, post_id: post.id)
end
elsif post.updated_at > 5.minutes.ago
elsif post.last_version_at > 5.minutes.ago
# bypass all validations here to maximize speed
post.update_columns(
raw: draft_body,