app/models/profiled/model/area.rb
# names must be an instance of Enumerator, first is root, child is after root
names must be an instance of Enumerator, first is root, child is after root
names must be an instance of Enumerator first is root child is after root
def sure_find_full(names, parent = nil)
        names = names.to_enum unless names.is_a? Enumerator
        area = find_or_initialize_by(full: names.next)
        if parent
          area.parent = parent
        end
        area.save
        sure_find_full(names, area)
      rescue StopIteration => e
        parent
      end
def sure_find_full ( names , parent = nil ) names = names . to_enum unless names . is_a? Enumerator area = find_or_initialize_by ( full : names . next ) if parent area . parent = parent end area . save sure_find_full ( names , area ) rescue StopIteration => e parent end
names must be an instance of Enumerator, first is root, child is after root
names must be an instance of Enumerator first is root child is after root
names
parent