Skip to content

Commit

Permalink
extended models dont need type on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
weepy committed Apr 29, 2012
1 parent c163542 commit 23e7851
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* array can now be extended
* added o_O.collection example file
* fixed bad enumeration in array::find
* extended models dont need type on creation

0.2.5
=====
Expand Down
8 changes: 2 additions & 6 deletions o_O.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ o_O.bindings = {
}
}

// o_O.newBinding = function(name, type, fn) {
// o_O.bindings[name] = fn
// fn.type = type
// }

/* general purpose
* `call: fn` will run once - useful for intialization
*/
Expand Down Expand Up @@ -568,7 +563,8 @@ extend(model, Events, {
return child;
},
create: function(o) {
var type = model.types[o.type]
o = o || {}
var type = this == model ? model.types[o.type] : this
if(!type) throw new Error('no such Model with type: ' + o.type)
return new type(o)
}
Expand Down

0 comments on commit 23e7851

Please sign in to comment.