mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-28 09:39:39 +02:00
18 lines
319 B
Ruby
18 lines
319 B
Ruby
|
module Transaction::Ruleable
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
def eligible_for_category_rule?
|
||
|
rules.joins(:actions).where(
|
||
|
actions: {
|
||
|
action_type: "set_transaction_category",
|
||
|
value: category_id
|
||
|
}
|
||
|
).empty?
|
||
|
end
|
||
|
|
||
|
private
|
||
|
def rules
|
||
|
entry.account.family.rules
|
||
|
end
|
||
|
end
|