chore(conditions): update condition_form
This commit is contained in:
parent
4d95f49c82
commit
28b07f7650
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@ class ConditionForm
|
||||||
include ActiveModel::Model
|
include ActiveModel::Model
|
||||||
include Logic
|
include Logic
|
||||||
|
|
||||||
attr_accessor :top_operator_name, :rows, :upper_tdcs
|
attr_accessor :top_operator_name, :rows, :source_tdcs
|
||||||
|
|
||||||
def to_condition
|
def to_condition
|
||||||
case sub_conditions.count
|
case sub_conditions.count
|
||||||
|
@ -22,7 +22,7 @@ class ConditionForm
|
||||||
end
|
end
|
||||||
|
|
||||||
def change_champ(i)
|
def change_champ(i)
|
||||||
sub_conditions[i] = Logic.ensure_compatibility_from_left(sub_conditions[i], upper_tdcs)
|
sub_conditions[i] = Logic.ensure_compatibility_from_left(sub_conditions[i], source_tdcs)
|
||||||
|
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -39,7 +39,7 @@ class ConditionForm
|
||||||
|
|
||||||
def row_to_condition(row)
|
def row_to_condition(row)
|
||||||
left = Logic.from_json(row[:targeted_champ])
|
left = Logic.from_json(row[:targeted_champ])
|
||||||
right = parse_value(left.type(upper_tdcs), row[:value])
|
right = parse_value(left.type(source_tdcs), row[:value])
|
||||||
|
|
||||||
Logic.class_from_name(row[:operator_name]).new(left, right)
|
Logic.class_from_name(row[:operator_name]).new(left, right)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue