Prevent reverting to foreign versions (fixes #2711).

This commit is contained in:
evazion
2016-10-10 10:24:49 +00:00
parent 80895ef46e
commit c46b31aa9c
12 changed files with 44 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ class NotesController < ApplicationController
def revert
@note = Note.find(params[:id])
@version = NoteVersion.find(params[:version_id])
@version = @note.versions.find(params[:version_id])
@note.revert_to!(@version)
respond_with(@note)
end