[#25,model][xs]: turns out the hack to allow simple arguments to Field ctor does *not* work.

This commit is contained in:
Rufus Pollock
2012-02-18 08:11:38 +00:00
parent 2da6c1a297
commit a75e04701f
2 changed files with 6 additions and 6 deletions

View File

@@ -96,8 +96,7 @@ my.Field = Backbone.Model.extend({
initialize: function(data) {
// if a hash not passed in the first argument is set as value for key 0
if ('0' in data) {
this.set({id: data['0']});
this.unset('0');
throw new Error('Looks like you did not pass a proper hash with id to Field constructor');
}
if (this.attributes.label == null) {
this.set({label: this.id});