{"record":{"id":"c4259ad9ce802f69","repo":"thoughtbot/shoulda-matchers","slug":"invalid-counter-cache-option","errorCode":null,"errorMessage":"Invalid counter_cache option","messagePattern":"Invalid counter_cache option","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb","lineNumber":64,"sourceCode":"              )\n            end\n          end\n\n          def option_verifier\n            @_option_verifier ||= OptionVerifier.new(subject)\n          end\n\n          def normalize_value\n            if Rails::VERSION::STRING >= '7.2'\n              case counter_cache\n              when true\n                { active: true, column: nil }\n              when String, Symbol\n                { active: true, column: counter_cache.to_s }\n              when Hash\n                { active: true, column: nil }.merge!(counter_cache)\n              else\n                raise ArgumentError, 'Invalid counter_cache option'\n              end\n            else\n              counter_cache\n            end\n          end\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":46,"sourceCodeEnd":75,"githubUrl":"https://github.com/thoughtbot/shoulda-matchers/blob/79cdfbc326e97c9b43991b644434ca53c1f62c4c/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb#L46-L75","documentation":"Error \"Invalid counter_cache option\" thrown in thoughtbot/shoulda-matchers.","triggerScenarios":"Thrown at lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79cdfbc326e97c9b43991b644434ca53c1f62c4c","analyzedAt":"2026-08-23T09:43:24.200Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}