Module: PgHaMigrations::ActiveRecordHacks::CleanupUnnecessaryOutput

Defined in:
lib/pg_ha_migrations/hacks/cleanup_unnecessary_output.rb

Instance Method Summary collapse

Instance Method Details

#adapter_nameObject

This is fixed in Rails 6+, but previously there were several places where #adapter_name was called directly which implicitly delegated to the connection through #method_missing. That delegation though results in wrapping the call in #say_with_time which unnecessarily outputs a bunch of calls to #adapter_name. The easiest way to clean this up retroactively is to just patch in a direct dispatch to the connection’s method.

See: github.com/rails/rails/commit/eb7c71bcd3d0c7e079dffdb11e43fb466eec06aa



15
16
17
# File 'lib/pg_ha_migrations/hacks/cleanup_unnecessary_output.rb', line 15

def adapter_name
  connection.adapter_name
end