mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Correctly test for an empty Tag array
issue #858 - fixes syntax errors in mysql
This commit is contained in:
parent
71711c1fd2
commit
e6b779330f
@ -128,7 +128,7 @@ Post = GhostBookshelf.Model.extend({
|
||||
}
|
||||
});
|
||||
|
||||
if (tagsToAttach) {
|
||||
if (!_.isEmpty(tagsToAttach)) {
|
||||
return Tags.forge().query('whereIn', 'name', _.pluck(tagsToAttach, 'name')).fetch().then(function (matchingTags) {
|
||||
_.each(matchingTags.toJSON(), function (matchingTag) {
|
||||
tagOperations.push(self.tags().attach(matchingTag.id));
|
||||
|
Loading…
Reference in New Issue
Block a user