mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 17:06:39 -06:00
Touch journals so issue #1036 is fixed.
This commit is contained in:
parent
462439a5ab
commit
1b56765da3
@ -60,6 +60,7 @@ class AddTag implements ActionInterface
|
||||
$count = $journal->tags()->where('tag_id', $tag->id)->count();
|
||||
if (0 === $count) {
|
||||
$journal->tags()->save($tag);
|
||||
$journal->touch();
|
||||
Log::debug(sprintf('RuleAction AddTag. Added tag #%d ("%s") to journal %d.', $tag->id, $tag->tag, $journal->id));
|
||||
|
||||
return true;
|
||||
|
@ -54,6 +54,7 @@ class ClearBudget implements ActionInterface
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->budgets()->detach();
|
||||
$journal->touch();
|
||||
Log::debug(sprintf('RuleAction ClearBudget removed all budgets from journal %d.', $journal->id));
|
||||
|
||||
return true;
|
||||
|
@ -54,6 +54,7 @@ class ClearCategory implements ActionInterface
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$journal->categories()->detach();
|
||||
$journal->touch();
|
||||
Log::debug(sprintf('RuleAction ClearCategory removed all categories from journal %d.', $journal->id));
|
||||
|
||||
return true;
|
||||
|
@ -60,6 +60,7 @@ class ClearNotes implements ActionInterface
|
||||
foreach ($notes as $note) {
|
||||
$note->delete();
|
||||
}
|
||||
$journal->touch();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ class RemoveAllTags implements ActionInterface
|
||||
{
|
||||
Log::debug(sprintf('RuleAction ClearCategory removed all tags from journal %d.', $journal->id));
|
||||
$journal->tags()->detach();
|
||||
$journal->touch();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class RemoveTag implements ActionInterface
|
||||
if (null !== $tag) {
|
||||
Log::debug(sprintf('RuleAction RemoveTag removed tag #%d ("%s") from journal #%d.', $tag->id, $tag->tag, $journal->id));
|
||||
$journal->tags()->detach([$tag->id]);
|
||||
|
||||
$journal->touch();
|
||||
return true;
|
||||
}
|
||||
Log::debug(sprintf('RuleAction RemoveTag tried to remove tag "%s" from journal #%d but no such tag exists.', $name, $journal->id));
|
||||
|
@ -88,7 +88,7 @@ class SetBudget implements ActionInterface
|
||||
Log::debug(sprintf('RuleAction SetBudget set the budget of journal #%d to budget #%d ("%s").', $journal->id, $budget->id, $budget->name));
|
||||
|
||||
$journal->budgets()->sync([$budget->id]);
|
||||
|
||||
$journal->touch();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class SetCategory implements ActionInterface
|
||||
$name = $this->action->action_value;
|
||||
$category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => $journal->user->id]);
|
||||
$journal->categories()->sync([$category->id]);
|
||||
|
||||
$journal->touch();
|
||||
Log::debug(sprintf('RuleAction SetCategory set the category of journal #%d to budget #%d ("%s").', $journal->id, $category->id, $category->name));
|
||||
|
||||
return true;
|
||||
|
@ -66,6 +66,7 @@ class SetDescription implements ActionInterface
|
||||
$this->action->action_value
|
||||
)
|
||||
);
|
||||
$journal->touch();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -103,6 +103,7 @@ class SetDestinationAccount implements ActionInterface
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
$transaction->account_id = $this->newDestinationAccount->id;
|
||||
$transaction->save();
|
||||
$journal->touch();
|
||||
Log::debug(sprintf('Updated transaction #%d and gave it new account ID.', $transaction->id));
|
||||
|
||||
return true;
|
||||
|
@ -104,6 +104,7 @@ class SetSourceAccount implements ActionInterface
|
||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
$transaction->account_id = $this->newSourceAccount->id;
|
||||
$transaction->save();
|
||||
$journal->touch();
|
||||
Log::debug(sprintf('Updated transaction #%d and gave it new account ID.', $transaction->id));
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user