Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A simple plugin which creates revisions of your model and comes with an equally simple differ.
Ruby
Branch: master

Don't ignore valid inserts after doing a word level diff.

Inserted elements were ignored after a complicated change on one line was
detected. Sometimes these inserts weren't the mirror insert of a delete
so they can't be ignored.

This is basically a quick workaround to check if the original delete is the
mirror of the insert. In cases with repeating patterns this can still go
wrong.

I don't think there is a mathematically valid way to solve this problem with
the LCS algorithm and callbacks, let's see where this takes us for now.
latest commit b7103efd08
@Manfred Manfred authored
Failed to load latest commit information.
lib Don't ignore valid inserts after doing a word level diff.
test Don't ignore valid inserts after doing a word level diff.
.travis.yml Add Travis configuration
Gemfile Add Gemfile for Travis
MIT-LICENSE Initial import.
README.md
Rakefile Strip Rakefile
revision-san.gemspec Remove non-existent files from the gemspec.

README.md

Revision-San

A simple Rails plugin which creates revisions of your model and comes with an equally simple HTML differ.

Install

$ gem install revision-san

Usage

Include the RevisionSan module into the model for which you'd like to keep revisions.

class Artist < ActiveRecord::Base
  include RevisionSan
end

And create a migration to add the columns needed by Revision-San to your model:

add_column :artists, :revision, :integer,           :default => 1
add_column :artists, :revision_parent_id, :integer, :default => nil

add_index  :artists, :revision_parent_id
Something went wrong with that request. Please try again.