def add_has_manys(row, attrs)
      headers_length = row.headers.compact.length
      pairs_start_on_evens = headers_length.even?
      (headers_length..row.fields.length).each do |i|
        i.send(pairs_start_on_evens ? :even? : :odd?) || next
        row[i] || next

        m = row[i].match(/^(\w+)_(\d+)_(\w+)$/)
        m || next
        has_many_name = m[1].pluralize
        has_many_index = m[2].to_i
        has_many_field = m[3]
        has_many_value = row[i + 1]

        has_many_config = @config.has_manys[has_many_name.to_sym]

        next unless has_many_config
        next unless has_many_config.fields.include?(has_many_field.to_sym)
        next if has_many_config.export_only_fields.include?(has_many_field.to_sym)

        attrs[has_many_name] ||= []
        attrs[has_many_name][has_many_index] ||= {}
        attrs[has_many_name][has_many_index][has_many_field] = has_many_value
      end
    end
def add_has_manys(row, attrs)
      headers_length = row.headers.compact.length
      pairs_start_on_evens = headers_length.even?
      (headers_length..row.fields.length).each do |i|
        i.send(pairs_start_on_evens ? :even? : :odd?) || next
        row[i] || next

        m = row[i].match(/^(\w+)_(\d+)_(\w+)$/)
        m || next
        has_many_name = m[1].pluralize
        has_many_index = m[2].to_i
        has_many_field = m[3]
        has_many_value = row[i + 1]

        has_many_config = @config.has_manys[has_many_name.to_sym]

        next unless has_many_config
        next unless has_many_config.fields.include?(has_many_field.to_sym)
        next if has_many_config.export_only_fields.include?(has_many_field.to_sym)

        attrs[has_many_name] ||= []
        attrs[has_many_name][has_many_index] ||= {}
        attrs[has_many_name][has_many_index][has_many_field] = has_many_value
      end
    end
Adds configured has manys to attrs