Skip to content

Commit

Permalink
Rever template behavior to use the #each_node #each_edge.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Apr 16, 2012
1 parent cf91f06 commit 2565dc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/diaspora-cluster-creator/template.rb
Expand Up @@ -27,13 +27,13 @@ def canvas
return @canvas if @canvas
@canvas = GraphViz.new(cluster.to_s, :type => :graph )

cluster.nodes.each do |node|
cluster.each_node do |node|
options = {}
options[:label] = (node.respond_to?(:label) ? node.label : node.to_s)
@canvas.add_nodes(node.to_s, options)
end

cluster.edges.each do |edge|
cluster.each_edge do |edge|
to = edge[0]
from = edge[1]
@canvas.add_edges(to.to_s, from.to_s)
Expand Down

0 comments on commit 2565dc7

Please sign in to comment.