diff --git a/rails/rubocop-for-gem.yml b/rails/rubocop-for-gem.yml
index 6ce1142e50106ccd469bfdc6c6fc605c759712d6..062527b000be697f1d08a3f2df9dd7e915cf3850 100644
--- a/rails/rubocop-for-gem.yml
+++ b/rails/rubocop-for-gem.yml
@@ -51,13 +51,13 @@ Metrics/AbcSize:
 Metrics/BlockLength:
   AllowedMethods: ['class_eval', 'module_eval', 'refine'] # default: 'refine'
   CountAsOne: &array_hash_heredoc_method_call ['array', 'hash', 'heredoc', 'method_call'] # default: []
-  Exclude: &test_config_db ['*.gemspec', '*/config/**/*', 'test/**/*', 'config/**/*', 'db/**/*']
+  Exclude: &test_config_db_gemspec_subconfig ['test/**/*', 'config/**/*', 'db/**/*', '*.gemspec', '**/*/config/*']
 
 # default is too restrictive, having some restriction incentivizes to split up overly large classes
 Metrics/ClassLength:
   CountAsOne: *array_hash_heredoc_method_call # default: []
   Max: 200 # default: 100
-  Exclude: *test_config_db
+  Exclude: *test_config_db_gemspec_subconfig
 
 # default is too restrictive, allow higher complexity
 Metrics/CyclomaticComplexity:
@@ -67,13 +67,13 @@ Metrics/CyclomaticComplexity:
 Metrics/MethodLength:
   CountAsOne: *array_hash_heredoc_method_call # default: []
   Max: 30 # default: 10
-  Exclude: *test_config_db
+  Exclude: *test_config_db_gemspec_subconfig
 
 # default is too restrictive, allow longer modules
 Metrics/ModuleLength:
   CountAsOne: *array_hash_heredoc_method_call # default: []
   Max: 200 # default: 100
-  Exclude: *test_config_db
+  Exclude: *test_config_db_gemspec_subconfig
 
 # long parameter lists add too much complexity, keyword args are named and thus more obvious what is expected, ignore them
 Metrics/ParameterLists:
@@ -141,11 +141,11 @@ Style/ClassAndModuleChildren:
 
 # documentation of classes in migrations and tests is not needed
 Style/Documentation:
-  Exclude: *test_config_db
+  Exclude: *test_config_db_gemspec_subconfig
 
 # allow in auto-generated files
 Style/GlobalStdStream:
-  Exclude: *test_config_db
+  Exclude: *test_config_db_gemspec_subconfig
 
 # allow empty parentheses to differentiate method calls vs attributes
 Style/MethodCallWithoutArgsParentheses: