app/models/note/versions_dependency.rb
# Revert to a version, this still create a new version
Revert to a version, this still create a new version
Revert to a version this still create a new version
def revert(version_id, user_id: nil)
    version = versions.find_by_id(version_id)
    if version.blank?
      errors.add(:base, "Revert version is invalid")
      return false
    end
    update(body: version.body_plain, body_sml: version.body_sml, format: version.format)
  end
def revert ( version_id , user_id : nil ) version = versions . find_by_id ( version_id ) if version . blank? errors . add ( :base , "Revert version is invalid" ) return false end update ( body : version . body_plain , body_sml : version . body_sml , format : version . format ) end
Revert to a version, this still create a new version
Revert to a version this still create a new version
version_id
<not_specific>
user_id
<not_specific>