From 58ac9e15c5fa1213078ceb293a30fab502d2bc21 Mon Sep 17 00:00:00 2001 From: cueedee Date: Thu, 28 Jul 2016 11:58:11 +0200 Subject: [PATCH] feat(model generator): add a model schema as a standard place to list and document your model's ttributes --- generators/model/templates/model.coffee | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/generators/model/templates/model.coffee b/generators/model/templates/model.coffee index 56f8e957..ee27af1d 100644 --- a/generators/model/templates/model.coffee +++ b/generators/model/templates/model.coffee @@ -20,6 +20,7 @@ 'use strict' + ###*<% if ( description ) { %> # <%- description %> #<% } %> @@ -29,7 +30,30 @@ # @constructor<% } %> ### - class <%- className %> extends Backbone.Model<% if ( singleton ) { %> + class <%- className %> extends Backbone.Model + + ###* + # List of [valid attribute names](#attrs). + # + # @property schema + # + # @type Array[String] + # @static + # @final + ### + + ###* + # The `<%- className %>`'s unique identifier. + # + # @attribute id + # + # @type String + ### + + schema: [ + + 'id' + ]<% if ( singleton ) { %> ## Export singleton.