Counter caches for associations with string keys have issues in at least 4.1. In 4.2 we noticed it because they throw exceptions when they try to use the string key to lookup the record on its primary key. This causes out of range exceptions if we have large numbers as string keys. Linked are test cases to reproduce. Throws exceptions in 4.2 and have test case failures in 4.1.
string_keys_and_counter_cache_4-1.rb
string_keys_and_counter_cache_4-2.rb
I tested 4.2.0 - 4.2.5. All with same behavior.
Counter caches for associations with string keys have issues in at least 4.1. In 4.2 we noticed it because they throw exceptions when they try to use the string key to lookup the record on its primary key. This causes out of range exceptions if we have large numbers as string keys. Linked are test cases to reproduce. Throws exceptions in 4.2 and have test case failures in 4.1.
string_keys_and_counter_cache_4-1.rb
string_keys_and_counter_cache_4-2.rb
I tested 4.2.0 - 4.2.5. All with same behavior.