Extending ParseUser causes wrong API urls to be called
musnit opened this issue · 3 comments
I have a few more extra fields on my Parse User table and so wanted to extend the EmberParseAdapter.ParseUser model with one specific to my app.
This causes creation of new Users to be put into a new Parse table called User, rather than into the special Parse _User table. It seems to be due to the way the adapter handles detecting the special parse _User type in the pathForType method?
pathForType: function(type) {
if ("parseUser" === type) {
return "users";
} else if ("login" === type) {
return "login";
} else {
return this.classesPath + '/' + this.parsePathForType(type);
}
},
(code taked from line 21+ in adapter.js)
Am I doing something wrong, or should the way in which the special _User class is being detected be improved?
PS: This probably causes issues with the belongsTo and hasMany serializer, as they both use a similar detection mechanism in the parseClassName method in the serializer.
Hmm I suppose if I extend the ParseUser class, and still call it a ParseUser under my own namespace it should work fine?
Should this 'constraint' be fixed or else added to the docs somewhere?
I thought you could add extra fields to the Parse user class, see this answer:
http://stackoverflow.com/a/26222264/3915717
I tried the following but the extra column (sendUpdates) wasn't created:
ParseUser = this.get('targetObject.store').modelFor('parse-user'),
data = {
username: this.get('username'),
password: this.get('password'),
email: this.get('email'),
sendUpdates: this.get('email')
};
My mistake, I done another refresh on parse.com and see that those fields were created fine :))