mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-27 17:19:39 +02:00
18 lines
378 B
Ruby
18 lines
378 B
Ruby
|
class Rule::Action < ApplicationRecord
|
||
|
belongs_to :rule
|
||
|
|
||
|
validates :action_type, presence: true
|
||
|
|
||
|
def apply(resource_scope, ignore_attribute_locks: false)
|
||
|
executor.execute(resource_scope, value: value, ignore_attribute_locks: ignore_attribute_locks)
|
||
|
end
|
||
|
|
||
|
def options
|
||
|
executor.options
|
||
|
end
|
||
|
|
||
|
def executor
|
||
|
rule.registry.get_executor!(action_type)
|
||
|
end
|
||
|
end
|