Method: ActiveRecord::QueryLogs.update_formatter

Defined in:
activerecord/lib/active_record/query_logs.rb

.update_formatter(format) ⇒ Object

Updates the formatter to be what the passed in format is.



100
101
102
103
104
105
106
107
108
109
110
# File 'activerecord/lib/active_record/query_logs.rb', line 100

def update_formatter(format)
  self.tags_formatter =
    case format
    when :legacy
      LegacyFormatter.new
    when :sqlcommenter
      SQLCommenter.new
    else
      raise ArgumentError, "Formatter is unsupported: #{formatter}"
    end
end