mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Add more descriptive labels to rule rows
This commit is contained in:
parent
04ee1e73be
commit
bcfbc4b324
3 changed files with 41 additions and 1 deletions
|
@ -11,6 +11,18 @@ class Rule::Action < ApplicationRecord
|
|||
executor.options
|
||||
end
|
||||
|
||||
def value_display
|
||||
if value.present?
|
||||
if options
|
||||
options.find { |option| option.last == value }&.first
|
||||
else
|
||||
""
|
||||
end
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def executor
|
||||
rule.registry.get_executor!(action_type)
|
||||
end
|
||||
|
|
|
@ -35,6 +35,18 @@ class Rule::Condition < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def value_display
|
||||
if value.present?
|
||||
if options
|
||||
options.find { |option| option.last == value }&.first
|
||||
else
|
||||
value
|
||||
end
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def options
|
||||
filter.options
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue