diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.php index 5373fdd6d4..42d6d23638 100644 --- a/app/Rules/Actions/SetBudget.php +++ b/app/Rules/Actions/SetBudget.php @@ -55,7 +55,7 @@ class SetBudget implements ActionInterface )->first(); if (!is_null($budget)) { Log::debug('Will set budget "' . $search . '" (#' . $budget->id . ') on journal #' . $this->journal->id . '.'); - $this->journal->budgets()->save($budget); + $this->journal->budgets()->sync([$budget->id]); } else { Log::debug('Could not find budget "' . $search . '". Failed.'); } diff --git a/app/Rules/Actions/SetCategory.php b/app/Rules/Actions/SetCategory.php index 764bfdc4d6..545040e24a 100644 --- a/app/Rules/Actions/SetCategory.php +++ b/app/Rules/Actions/SetCategory.php @@ -47,7 +47,7 @@ class SetCategory implements ActionInterface $name = $this->action->action_value; $category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]); Log::debug('Will set category "' . $name . '" (#' . $category->id . ') on journal #' . $this->journal->id . '.'); - $this->journal->categories()->save($category); + $this->journal->categories()->sync([$category->id]); return true; } diff --git a/phpunit.cover.xml b/phpunit.cover.xml index 68aa93f342..a37e48b5e4 100755 --- a/phpunit.cover.xml +++ b/phpunit.cover.xml @@ -23,10 +23,28 @@ - app/ + app/Http vendor/ + app/Console + app/Events + app/Exceptions + app/Generator + app/Handlers + app/Helpers + + app/Jobs + app/Listeners + app/Models + app/Policies + app/Providers + app/Repositories + app/Rules + app/Sql + app/Support + app/Validation +