lib/supa/commands/polymorphic.rb in supa-0.1.1 vs lib/supa/commands/polymorphic.rb in supa-0.1.2

- old
+ new

@@ -2,17 +2,15 @@ module Supa module Commands class Polymorphic < Supa::Command def represent - values = with_getter? ? context.instance_exec(&getter) : context.send(name) - tree[name] ||= [] - Array(values).each do |value| + Array(get_value).each do |element| tree[name] << {} - Supa::Builder.new(context: value, tree: tree[name][-1]).instance_exec(&block) + Supa::Builder.new(context: element, tree: tree[name][-1]).instance_exec(&block) end end end end end