Refactor: grouping parent and their space by including array.

This commit is contained in:
Sato Hiroyuki 2013-03-06 21:01:40 +09:00
parent 2f7f46b256
commit 784aa266bd
3 changed files with 7 additions and 5 deletions

View file

@ -2,4 +2,9 @@ module GraphHelper
def join_with_space(ary)
ary.collect{|r|r.name}.join(" ") unless ary.nil?
end
def parents_zip_spaces(parents, parent_spaces)
ids = parents.map { |p| p.id }
ids.zip(parent_spaces)
end
end