Handle id and data in sharedCtor
This commit is contained in:
parent
087e3eabcb
commit
ca3a3c468c
|
@ -124,7 +124,11 @@ app.define = function (name, properties, options) {
|
|||
id = null;
|
||||
}
|
||||
|
||||
if(data) {
|
||||
if(id && data) {
|
||||
var model = new ModelCtor(data);
|
||||
model.id = id;
|
||||
fn(null, model);
|
||||
} else if(data) {
|
||||
fn(null, new ModelCtor(data));
|
||||
} else if(id) {
|
||||
ModelCtor.find(id, fn);
|
||||
|
|
Loading…
Reference in New Issue