diff options
Diffstat (limited to 'rubocop/cop/usage_data/distinct_count_by_large_foreign_key.rb')
-rw-r--r-- | rubocop/cop/usage_data/distinct_count_by_large_foreign_key.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rubocop/cop/usage_data/distinct_count_by_large_foreign_key.rb b/rubocop/cop/usage_data/distinct_count_by_large_foreign_key.rb index 3aad089d961..a083318288b 100644 --- a/rubocop/cop/usage_data/distinct_count_by_large_foreign_key.rb +++ b/rubocop/cop/usage_data/distinct_count_by_large_foreign_key.rb @@ -12,7 +12,7 @@ module RuboCop # # bad because pipeline_id points to a large table # distinct_count(Ci::Build, :commit_id) # - class DistinctCountByLargeForeignKey < RuboCop::Cop::Cop + class DistinctCountByLargeForeignKey < RuboCop::Cop::Base MSG = 'Avoid doing `%s` on foreign keys for large tables having above 100 million rows.' def_node_matcher :distinct_count?, <<-PATTERN @@ -25,7 +25,7 @@ module RuboCop next if batch_set_to_false?(method_arguments[2]) next if allowed_foreign_key?(method_arguments[1]) - add_offense(node, location: :selector, message: format(MSG, method_name)) + add_offense(node.loc.selector, message: format(MSG, method_name)) end end |