lib/flipper/api/v1/decorators/feature.rb in flipper-api-0.17.2 vs lib/flipper/api/v1/decorators/feature.rb in flipper-api-0.18.0

- old
+ new

@@ -10,15 +10,17 @@ alias_method :feature, :__getobj__ # Public: Returns instance as hash that is ready to be json dumped. def as_json gate_values = feature.adapter.get(self) + gates_json = gates.map do |gate| + Decorators::Gate.new(gate, gate_values[gate.key]).as_json + end + { 'key' => key, 'state' => state.to_s, - 'gates' => gates.map do |gate| - Decorators::Gate.new(gate, gate_values[gate.key]).as_json - end, + 'gates' => gates_json, } end end end end