From 2da76ef2d37375c5608681970e2f511ed4c898a7 Mon Sep 17 00:00:00 2001 From: Dylan Griffith <dyl.griffith@gmail.com> Date: Tue, 11 Jul 2023 04:03:11 +0000 Subject: [PATCH] Fix typo in error message for IgnorableColumns rubocop error --- rubocop/cop/ignored_columns.rb | 4 ++-- spec/rubocop/cop/ignored_columns_spec.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rubocop/cop/ignored_columns.rb b/rubocop/cop/ignored_columns.rb index 8b17447c46b7a..86ab8df6927fa 100644 --- a/rubocop/cop/ignored_columns.rb +++ b/rubocop/cop/ignored_columns.rb @@ -19,8 +19,8 @@ module Cop # ignore_column :full_name, remove_after: '2023-05-22', remove_with: '16.0' # end class IgnoredColumns < RuboCop::Cop::Base - USE_CONCERN_ADD_MSG = 'Use `IgnoredColumns` concern instead of adding to `self.ignored_columns`.' - USE_CONCERN_SET_MSG = 'Use `IgnoredColumns` concern instead of setting `self.ignored_columns`.' + USE_CONCERN_ADD_MSG = 'Use `IgnorableColumns` concern instead of adding to `self.ignored_columns`.' + USE_CONCERN_SET_MSG = 'Use `IgnorableColumns` concern instead of setting `self.ignored_columns`.' WRONG_MODEL_MSG = <<~MSG If the model exists in CE and EE, the column has to be ignored in the CE model. If the model only exists in EE, then it has to be added there. diff --git a/spec/rubocop/cop/ignored_columns_spec.rb b/spec/rubocop/cop/ignored_columns_spec.rb index 8d2c6b92c7098..c8f47f8aee920 100644 --- a/spec/rubocop/cop/ignored_columns_spec.rb +++ b/spec/rubocop/cop/ignored_columns_spec.rb @@ -4,20 +4,20 @@ require_relative '../../../rubocop/cop/ignored_columns' RSpec.describe RuboCop::Cop::IgnoredColumns, feature_category: :database do - it 'flags use of `self.ignored_columns +=` instead of the IgnoredColumns concern' do + it 'flags use of `self.ignored_columns +=` instead of the IgnorableColumns concern' do expect_offense(<<~RUBY) class Foo < ApplicationRecord self.ignored_columns += %i[id] - ^^^^^^^^^^^^^^^ Use `IgnoredColumns` concern instead of adding to `self.ignored_columns`. + ^^^^^^^^^^^^^^^ Use `IgnorableColumns` concern instead of adding to `self.ignored_columns`. end RUBY end - it 'flags use of `self.ignored_columns =` instead of the IgnoredColumns concern' do + it 'flags use of `self.ignored_columns =` instead of the IgnorableColumns concern' do expect_offense(<<~RUBY) class Foo < ApplicationRecord self.ignored_columns = %i[id] - ^^^^^^^^^^^^^^^ Use `IgnoredColumns` concern instead of setting `self.ignored_columns`. + ^^^^^^^^^^^^^^^ Use `IgnorableColumns` concern instead of setting `self.ignored_columns`. end RUBY end -- GitLab