summaryrefslogtreecommitdiff
path: root/app/helpers/graph_helper.rb
blob: ca7d823a45a50c5a731923039a1b825316510430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module GraphHelper
  def get_refs(commit)
    refs = ""
    refs += commit.refs.collect{|r|r.name}.join(" ") if commit.refs

    # append note count
    notes = @project.notes.for_commit_id(commit.id)
    refs += "[#{notes.count}]" if notes.any?

    refs
  end

  def parents_zip_spaces(parents, parent_spaces)
    ids = parents.map { |p| p.id }
    ids.zip(parent_spaces)
  end
end