mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
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:
parent
53063366e0
commit
1ff9550e1f
@ -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 () {
|
||||
this.on('saving', this.saving, this);
|
||||
this.on('saving', this.validate, this);
|
||||
|
Loading…
Reference in New Issue
Block a user