Skip to content

Commit

Permalink
bumped version to v0.1.4 and added release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Bailey committed Sep 10, 2011
1 parent b0c2956 commit a254966
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backbone.memento.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.Memento v0.1.3
// Backbone.Memento v0.1.4
//
// Copyright (C)2011 Derick Bailey, Muted Solutions, LLC
// Distributed Under MIT Liscene
Expand All @@ -10,7 +10,7 @@
// Backbone.Memento
// ----------------------------
Backbone.Memento = function(model, config){
this.version = "0.1.3";
this.version = "0.1.4";

config = _.extend({
ignore: []
Expand Down
25 changes: 25 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ SomeModel = Backbone.Model.extend({
});
````

## Ignore Some Attributes

There are some scenarios where it may cause issues to have all attributes restored from
a previous state, for a model. In this case, you can ignore specific attributes for
the model.

You can configure the memento to ignore the attributes when instantiating the memento:

````
SomeModel = Backbone.Model.extend({
initialize: function(){
this.memento = new Backbone.Memento(this{
ignore: ["someAttr", "another", "whatever", "..."]
});
},
// ...
});
````


## Examples

With this in place, you can push your model's state onto the memento stack by calling
Expand Down Expand Up @@ -97,6 +118,10 @@ myModel.get("bar"); // => undefined, as the attribute does not exist

# Release Notes

## v0.1.4

* ability to ignore model attributes - they won't be stored or restored

## v0.1.3

* Fixed a small bug with rolling back more times than had been saved
Expand Down

0 comments on commit a254966

Please sign in to comment.