mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
commit
7ebc7f7ff1
1 changed files with 3 additions and 0 deletions
|
@ -245,6 +245,7 @@ User = ghostBookshelf.Model.extend({
|
||||||
findOne: function findOne(data, options) {
|
findOne: function findOne(data, options) {
|
||||||
var query,
|
var query,
|
||||||
status,
|
status,
|
||||||
|
optInc,
|
||||||
lookupRole = data.role;
|
lookupRole = data.role;
|
||||||
|
|
||||||
delete data.role;
|
delete data.role;
|
||||||
|
@ -257,6 +258,7 @@ User = ghostBookshelf.Model.extend({
|
||||||
delete data.status;
|
delete data.status;
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
optInc = options.include;
|
||||||
options.withRelated = _.union(options.withRelated, options.include);
|
options.withRelated = _.union(options.withRelated, options.include);
|
||||||
data = this.filterData(data);
|
data = this.filterData(data);
|
||||||
|
|
||||||
|
@ -285,6 +287,7 @@ User = ghostBookshelf.Model.extend({
|
||||||
|
|
||||||
options = this.filterOptions(options, 'findOne');
|
options = this.filterOptions(options, 'findOne');
|
||||||
delete options.include;
|
delete options.include;
|
||||||
|
options.include = optInc;
|
||||||
|
|
||||||
return query.fetch(options);
|
return query.fetch(options);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue