class RuboCop::Cop::Discourse::NoResetColumnInformationInMigrations

Do not use `ActiveRecord::ModelSchema.reset_column_information` in migrations. The method is not thread safe and we run migrations concurrently for multisites. Also, we don't encourage the use of ActiveRecord methods in migrations and prefer to write SQL directly.

Constants

MSG

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/discourse/no_reset_column_information_in_migrations.rb, line 16
def on_send(node)
  return if node.method_name != :reset_column_information
  add_offense(node, message: MSG)
end