app/models/media/object.rb
# returns an array of group name strings from all nested groups
returns an array of group name strings from all nested groups
returns an array of group name strings from all nested groups
def respect_ancestors(answer_group, repeat_groups)
      name = answer_group.group_name
      name += (answer_group.new_rank + 1).to_s if answer_group.repeatable?
      repeat_groups << name
      if answer_group.parent_id.present?
        parent_answer_group = next_agroup_up(answer_group.parent_id)
        if parent_answer_group.present? && parent_answer_group.group_name.present?
          repeat_groups = respect_ancestors(parent_answer_group, repeat_groups)
        end
      end
      repeat_groups
    end
def respect_ancestors ( answer_group , repeat_groups ) name = answer_group . group_name name += ( answer_group . new_rank + 1 ) . to_s if answer_group . repeatable? repeat_groups << name if answer_group . parent_id . present? parent_answer_group = next_agroup_up ( answer_group . parent_id ) if parent_answer_group . present? && parent_answer_group . group_name . present? repeat_groups = respect_ancestors ( parent_answer_group , repeat_groups ) end end repeat_groups end
returns an array of group name strings from all nested groups
returns an array of group name strings from all nested groups
answer_group
<not_specific>
repeat_groups
<not_specific>