mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 13:05:19 +02:00
Encapsulate enrichment actions, add tests
This commit is contained in:
parent
dd605a577e
commit
94a807c3c9
9 changed files with 149 additions and 71 deletions
|
@ -16,14 +16,11 @@ class Rule::ActionExecutor::SetTransactionName < Rule::ActionExecutor
|
|||
end
|
||||
|
||||
scope.each do |txn|
|
||||
Rule.transaction do
|
||||
txn.entry.log_enrichment!(
|
||||
attribute_name: "name",
|
||||
attribute_value: value,
|
||||
source: "rule"
|
||||
)
|
||||
txn.entry.update!(name: value)
|
||||
end
|
||||
txn.entry.enrich_attribute(
|
||||
:name,
|
||||
value,
|
||||
source: "rule"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue