User property aliases

issue #389

 - Temporary aliases for user model, schema will be changed soon, in the meantime we want themes to be built using the right properties
This commit is contained in:
Hannah Wolfe 2013-09-02 20:16:13 +01:00
parent 53063366e0
commit 1ff9550e1f

View File

@ -45,6 +45,20 @@ User = GhostBookshelf.Model.extend({
}; };
}, },
parse: function (attrs) {
// temporary alias of name for full_name (will get changed in the schema)
if (attrs.full_name && !attrs.name) {
attrs.name = attrs.full_name;
}
// temporary alias of website for url (will get changed in the schema)
if (attrs.url && !attrs.website) {
attrs.website = attrs.url;
}
return attrs;
},
initialize: function () { initialize: function () {
this.on('saving', this.saving, this); this.on('saving', this.saving, this);
this.on('saving', this.validate, this); this.on('saving', this.validate, this);