def aggregate(request)
      @request_object = RequestLogAnalyzer::Database::Request.new(first_lineno: request.first_lineno, last_lineno: request.last_lineno)
      request.lines.each do |line|
        class_columns = database.get_class(line[:line_type]).column_names.reject { |column| %w(id source_id request_id).include?(column) }
        attributes = Hash[*line.select { |(key, _)| class_columns.include?(key.to_s) }.flatten]

        # Fix encoding patch for 1.9.2
        attributes.each do |k, v|
          attributes[k] = v.force_encoding('UTF-8') if v.is_a?(String)
        end

        @request_object.send("#{line[:line_type]}_lines").build(attributes)
      end
      @request_object.save!
    rescue SQLite3::SQLException => e
      raise Interrupt, e.message
    end
def aggregate(request)
      @request_object = RequestLogAnalyzer::Database::Request.new(first_lineno: request.first_lineno, last_lineno: request.last_lineno)
      request.lines.each do |line|
        class_columns = database.get_class(line[:line_type]).column_names.reject { |column| %w(id source_id request_id).include?(column) }
        attributes = Hash[*line.select { |(key, _)| class_columns.include?(key.to_s) }.flatten]

        # Fix encoding patch for 1.9.2
        attributes.each do |k, v|
          attributes[k] = v.force_encoding('UTF-8') if v.is_a?(String)
        end

        @request_object.send("#{line[:line_type]}_lines").build(attributes)
      end
      @request_object.save!
    rescue SQLite3::SQLException => e
      raise Interrupt, e.message
    end
Aggregates a request into the database
 This will create a record in the requests table and create a record for every line that has been parsed,
 in which the captured values will be stored.