Closed ahacking closed 10 years ago
Hmm... can you verify you are using the latest build of Ember Model? http://builds.erikbryn.com/ember-model/ember-model-latest.js
OK.
I was using master in my bower.json (I use brunch and bower for my client development workflow):
"ember-model": "ebryn/ember-model"
But I have now switched back to latest as per your url:
"ember-model": "http://builds.erikbryn.com/ember-model/ember-model-latest.js",
Brunch kicked off bower, rebuilt my vendor js, the page auto-refreshed and it is now working correctly.
So it looks like there is a regression in master then.
Thanks for your help!
@ahacking If you use bower, you're not on master. ember-model-latest.js
is master.
I am finding that changes to properties within embedded
belongsTo
relationships don't record the dirty change in the outer model as is done for hasMany. I can understand this would be unexpected in the non embedded case given the ownership connotations ofbelongsTo
but certainly not for the embedded case.A typical/example use case is a Person model with an embedded Address is never marked dirty when the address fields are modified in a web form. A Save button with its enabled state based on the isDirty property of controller.content (ie the Contact model) is therefore never enabled.
As an aside I'm not a fan of the ownership based naming (especially in the embedded
belongsTo
case) and much prefer pure cardinality based naming likehasOne
andhasMany
. Has consideration been given to changing the name so it doesn't convey ownership semantics? I added an alias methodhasOne
to my use ofEmber.Model
so the model definitions make sense reading them.