Sha256: ef1d3d276177160c07602ea647065a3b6fc99f8d365b53ad3889a7056f35a0e9
Contents?: true
Size: 984 Bytes
Versions: 10
Compression:
Stored size: 984 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Discourse # 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. class NoResetColumnInformationInMigrations < Base MSG = "ActiveRecord::ModelSchema.reset_column_information is not thread-safe " \ "and we run migrations concurrently on multisite clusters. Using this " \ "method also means ActiveRecord methods are being used in migration " \ "which is discouraged at Discourse. Instead, you should write SQL in your migrations instead." def on_send(node) return if node.method_name != :reset_column_information add_offense(node, message: MSG) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems