≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Feature request #1202

Feature request #1202: Keep history of wiki edits, possibly other edits as well

Kind feature request
Product wincent.dev
When Created 2009-01-19T23:50:49Z, updated 2015-04-07T16:55:47Z
Status open
Reporter Greg Hurrell
Tags no tags

Description

I just accidentally destroyed an article.

  1. Visit old article with similar structure to one I'd like to create.
  2. Edit old article in place in order to create new one.
  3. Realize that your "new" article effectively destroyed the old one because it took it's place.

So it was a silly mistake on my part, but it would be nice if the system protected me from such mistkes. (In this case I was able to recover the old content by using the Google cache.)

When developing the wiki software I originally did have revisions in place, but decided to rip them out because it was probably a case of over-engineering for a wiki like this (not a community-driven wiki, rather just a place to keep notes).

So now I am going to look at retro-fitting revisions on after all. And if I am going to do that I might look at doing it for things like weblog posts and possibly issues and comments as well.

Comments

  1. Greg Hurrell 2009-04-17T08:35:23Z

    See also ticket #1248, "Auto-save posts/articles etc being edited".

  2. Greg Hurrell 2009-11-17T16:33:34Z

    Possibly useful examples:

    • http://github.com/laserlemon/vestal_versions
    • http://github.com/mmower/simply_versioned
  3. Greg Hurrell 2010-06-24T09:08:04Z

    Another option to consider is storing stuff in a Git repo, which would give us some bonus behavior (logging, diffs) "for free", but would most likely be a little more IO intensive (forking out to git rather than accessing the database).

  4. Greg Hurrell 2010-07-23T12:51:11Z

    Another case which just bit me: session expired when window was left open for a long time. When I hit the submit button I got auto-redirected to the log-in page, and when I logged in I could no long use the back button to get back to the form (probably would have been fine if I had just clicked back rather than logging in).

    So really need some kind of auto-save functionality for that.

  5. Greg Hurrell 2011-12-12T00:06:22Z

    See also ticket #1935, which is about adding versioning to the snippets model.

  6. Greg Hurrell 2011-12-12T00:12:31Z

    Easiest way to do this will be to have a versions table with a Yaml or JSON serialization of the versioned model (along with some meta info, such as related type, related id etc.

  7. Greg Hurrell 2013-08-02T06:33:26Z

    Envisioning an API something like this:

    class Article < ActiveRecord::Base
      version :title, :redirect, :body
    end
    
    a = Article.first
    a.id #=> 1
    a.version #=> 1
    a.update_attribute(:body, 'more info!')
    a.version #=> 2
    a.rollback
    a.body #=> 'original body'
    a.version #=> 1
    a.reload
    a.version #=> 2
    a.body #=> 'more info!'
    a.rollback!
    a.body #=> 'original body'
    a.version #=> 3
    a.reload
    a.body #=> 'original body'
    a.rollback(3.minutes.ago)
    a.version #=> 1
    a.reload
    a.version #=> 3
    a.rollback!(3.minutes.ago)
    a.reload
    a.version #=> 4
    Version #=> Version(id: integer, versioned_id: integer, versioned_type: string, version: integer, content: text)
    Version.last.content #=> { title: 'dat article', redirect: '', body: 'original body' }
  8. Greg Hurrell 2015-04-07T16:55:47Z

    See also issue #2198.

Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets