Class: ActiveRecord::QueryLogs::LegacyFormatter

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/query_logs_formatter.rb

Overview

:nodoc:

Direct Known Subclasses

SQLCommenter

Instance Method Summary collapse

Constructor Details

#initializeLegacyFormatter

Returns a new instance of LegacyFormatter.



6
7
8
# File 'activerecord/lib/active_record/query_logs_formatter.rb', line 6

def initialize
  @key_value_separator = ":"
end

Instance Method Details

#format(pairs) ⇒ Object

Formats the key value pairs into a string.



11
12
13
14
15
# File 'activerecord/lib/active_record/query_logs_formatter.rb', line 11

def format(pairs)
  pairs.map! do |key, value|
    "#{key}#{key_value_separator}#{format_value(value)}"
  end.join(",")
end