notes: merge versions when note is deleted.

Unlike other models, notes had a special rule where if you deleted or
undeleted a note, it would always create a new version instead of
merging it into the previous version. Remove this rule since it didn't
have a purpose and it was inconsistent with other versioned models.
This commit is contained in:
evazion
2022-09-12 21:33:04 -05:00
parent 0267e4e3d7
commit fb980d4a16

View File

@@ -92,7 +92,7 @@ class Note < ApplicationRecord
def merge_version?(updater_id)
prev = versions.last
prev && prev.updater_id == updater_id && prev.updated_at > 1.hour.ago && !saved_change_to_is_active?
prev && prev.updater_id == updater_id && prev.updated_at > 1.hour.ago
end
def revert_to(version)