Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Allow note to skip versioning.
Browse files Browse the repository at this point in the history
No version is created when the note has the instruction __UNVERSION (or
a synonym).
  • Loading branch information
joegatt committed Jul 6, 2013
1 parent f23ba8e commit 9d37d2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Note < ActiveRecord::Base

has_paper_trail on: [:update],
only: [:title, :body],
unless: proc { |note| note.has_instruction?('reset') },
unless: proc { |note| note.has_instruction?('reset') || note.has_instruction?('unversion') },
meta: {
word_count: proc { |note| Note.find(note.id).word_count },
sequence: proc { |note| note.versions.length + 1 }, # To retrieve by version number
Expand Down
5 changes: 3 additions & 2 deletions config/nembrot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ defaults: &defaults
allowed_html_attributes: ['href', 'src', 'alt', 'cite']
attempts: 3
instructions:
home: ['__HOME']
citation: ['__QUOTE', '__CITATION']
default: ['__TRI']
hide: ['__HIDE']
home: ['__HOME']
ignore: ['__IGNORE', '__HOLD']
required: ['__PUBLISH']
reset: ['__RESET']
unlist: ['__UNLIST', '__NOLIST']
unlist: ['__UNLIST', '__NO_LIST']
unversion: ['__UNVERSION', '__NO_VERSION']
index:
page_size: 30
books:
Expand Down

0 comments on commit 9d37d2d

Please sign in to comment.