Skip to content

Instantly share code, notes, and snippets.

@iafonov
Created November 29, 2010 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iafonov/719979 to your computer and use it in GitHub Desktop.
Save iafonov/719979 to your computer and use it in GitHub Desktop.
Transaction = Backbone.Model.extend({
allAttributes: function() {
return _(this.attributes).extend(this.virtualAttributes());
},
virtualAttributes: function() {
return { accountFrom: this.accountFrom(), accountTo: this.accountTo(), transactionSumCents: this.transactionSumCents() };
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment