mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Allow rule to be applied to transactions (not just group).
This commit is contained in:
@@ -59,9 +59,11 @@ final class Processor
|
||||
*
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @param bool $includeActions
|
||||
*
|
||||
* @return Processor
|
||||
*/
|
||||
public static function make(Rule $rule)
|
||||
public static function make(Rule $rule, $includeActions = true)
|
||||
{
|
||||
Log::debug(sprintf('Making new rule from Rule %d', $rule->id));
|
||||
$self = new self;
|
||||
@@ -72,7 +74,9 @@ final class Processor
|
||||
Log::debug(sprintf('Push trigger %d', $trigger->id));
|
||||
$self->triggers->push(TriggerFactory::getTrigger($trigger));
|
||||
}
|
||||
$self->actions = $rule->ruleActions()->orderBy('order', 'ASC')->get();
|
||||
if ($includeActions) {
|
||||
$self->actions = $rule->ruleActions()->orderBy('order', 'ASC')->get();
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
Reference in New Issue
Block a user