Module: SafePgMigrations::Polyfills::VerboseQueryLogsPolyfill

Defined in:
lib/safe-pg-migrations/polyfills/verbose_query_logs_polyfill.rb

Class Method Summary collapse

Class Method Details

.verbose_query_logsObject



7
8
9
10
11
# File 'lib/safe-pg-migrations/polyfills/verbose_query_logs_polyfill.rb', line 7

def verbose_query_logs
  return ActiveRecord.verbose_query_logs if Helpers::SatisfiedHelper.satisfied? '>=7.0.0'

  ActiveRecord::Base.verbose_query_logs
end

.verbose_query_logs=(value) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/safe-pg-migrations/polyfills/verbose_query_logs_polyfill.rb', line 13

def verbose_query_logs=(value)
  if Helpers::SatisfiedHelper.satisfied? '>=7.0.0'
    ActiveRecord.verbose_query_logs = value
    return
  end

  ActiveRecord::Base.verbose_query_logs = value
end