Class: TFSGraph::ChangesetTreeCreator
- Inherits:
-
Object
- Object
- TFSGraph::ChangesetTreeCreator
- Defined in:
- lib/tfs_graph/associators/changeset_tree_creator.rb
Class Method Summary collapse
Class Method Details
.to_tree(branch) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/tfs_graph/associators/changeset_tree_creator.rb', line 4 def to_tree(branch) changesets = branch.changesets changesets.each.with_index do |changeset, i| parent = (i == 0) ? branch : changesets[i-1] if Changeset.find parent.id changeset.parent = parent.id changeset.save end ::Relationship.create :child, parent, changeset end end |