Merge pull request #198 from roberthorlings/bugfix/rule-action-addtag

Bugfix for a bug when adding a tag in a rule
This commit is contained in:
James Cole 2016-02-24 14:09:00 +01:00
commit 7921fc74fd

View File

@ -47,7 +47,7 @@ class AddTag implements ActionInterface
// journal has this tag maybe?
$tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => Auth::user()->id]);
$count = $journal->tags()->where('id', $tag->id)->count();
$count = $journal->tags()->where('tag_id', $tag->id)->count();
if ($count == 0) {
$journal->tags()->save($tag);
}