Do not create empty tags and remove tags only when necessary

This commit is contained in:
Frederic Guillot
2016-07-02 11:50:32 -04:00
parent 6db72521ea
commit 853189a43f
6 changed files with 325 additions and 316 deletions

View File

@@ -82,6 +82,7 @@ class TaskTagModel extends Base
public function save($project_id, $task_id, array $tags)
{
$task_tags = $this->getList($task_id);
$tags = array_filter($tags);
return $this->associateTags($project_id, $task_id, $task_tags, $tags) &&
$this->dissociateTags($task_id, $task_tags, $tags);