mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 04:24:06 +00:00
Add more descriptive labels to rule rows
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user