1. Kenneth Jørgensen
  2. antifreeze

Commits

Kenneth Jørgensen  committed b663327

Added Model serialize function

  • Participants
  • Parent commits 4dd0054
  • Branches default

Comments (0)

Files changed (1)

File src/Model.coffee

View file
  • Ignore whitespace
 		#for own key, val of json
 		#	if val and typeof val.toJSON is "function"
 		#		json[key] = val.toJSON()
-		return json
+		return json
+
+	# Serializes the model for persistent storage.
+	# By default this returns a JSON object, but feel free to extend.
+	serialize: ->
+		return @toJSON()