Sha256: 61113fc6a2fdcbc85063f4ec7f0f5aaa209439a46cede5c3e8ef5a609ceeac44

Contents?: true

Size: 615 Bytes

Versions: 4

Compression:

Stored size: 615 Bytes

Contents

class RequestLogAnalyzer::Database::Request < RequestLogAnalyzer::Database::Base
  
  # Returns an array of all the Line objects of this request in the correct order.
  def lines
    @lines ||= begin
      lines = []
      self.class.reflections.each { |r, d| lines += self.send(r).all }
      lines.sort
    end
  end
  
  # Creates the table to store requests in.
  def self.create_table!
    unless database.connection.table_exists?(:requests)
      database.connection.create_table(:requests) do |t|
        t.column :first_lineno, :integer
        t.column :last_lineno,  :integer
      end
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
wvanbergen-request-log-analyzer-1.3.6 lib/request_log_analyzer/database/request.rb
wvanbergen-request-log-analyzer-1.3.7 lib/request_log_analyzer/database/request.rb
request-log-analyzer-1.3.7 lib/request_log_analyzer/database/request.rb
request-log-analyzer-1.3.6 lib/request_log_analyzer/database/request.rb