0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Merge pull request #3345 from novaugust/model-relationships

Add relationships to client models
This commit is contained in:
Hannah Wolfe 2014-07-21 16:17:43 +01:00
commit 95d3925c3e
3 changed files with 14 additions and 17 deletions

View file

@ -1,15 +1,15 @@
var Tag = DS.Model.extend({
uuid: DS.attr('string'),
name: DS.attr('string'),
slug: DS.attr('string'),
description: DS.attr('string'),
parent_id: DS.attr('number'),
meta_title: DS.attr('string'),
meta_description: DS.attr('string'),
created_at: DS.attr('date'),
created_by: DS.attr('number'),
updated_at: DS.attr('date'),
updated_by: DS.attr('number')
uuid: DS.attr('string'),
name: DS.attr('string'),
slug: DS.attr('string'),
description: DS.attr('string'),
parent_id: DS.attr('number'),
meta_title: DS.attr('string'),
meta_description: DS.attr('string'),
created_at: DS.attr('moment-date'),
created_by: DS.belongsTo('user', {async: true}),
updated_at: DS.attr('moment-date'),
updated_by: DS.belongsTo('user', {async: true})
});
export default Tag;
export default Tag;

View file

@ -20,9 +20,9 @@ var User = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
meta_description: DS.attr('string'),
last_login: DS.attr('moment-date'),
created_at: DS.attr('moment-date'),
created_by: DS.attr('number'),
created_by: DS.belongsTo('user', { async: true }),
updated_at: DS.attr('moment-date'),
updated_by: DS.attr('number'),
updated_by: DS.belongsTo('user', { async: true }),
saveNewPassword: function () {
var url = this.get('ghostPaths.url').api('users', 'password');

View file

@ -1,9 +1,6 @@
import {mobileQuery} from 'ghost/utils/mobile';
var SettingsIndexRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, {
activate: function () {
this._super();
},
// redirect to general tab, unless on a mobile phone
beforeModel: function () {
if (!mobileQuery.matches) {