Skip to content

Commit f8ea862

Browse files
committed
feat: get-rid-of-extra-map-nested-rule-function
1 parent d86ba90 commit f8ea862

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/flagsmith/engine/evaluation/mappers/segments.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def self.map_rule(rule)
5252
{
5353
type: rule.type,
5454
conditions: map_conditions(rule.conditions),
55-
rules: map_nested_rules(rule.rules)
55+
rules: (rule.rules || []).map { |nested_rule| map_rule(nested_rule) }
5656
}
5757
end
5858

@@ -61,12 +61,6 @@ def self.map_conditions(conditions)
6161
{ property: condition.property, operator: condition.operator, value: condition.value }
6262
end
6363
end
64-
65-
def self.map_nested_rules(rules)
66-
return [] unless rules&.any?
67-
68-
rules.map { |nested_rule| map_rule(nested_rule) }
69-
end
7064
end
7165
end
7266
end

0 commit comments

Comments
 (0)