I noticed that in
ActiveRecord::Core, when we cache the
StatementCache values (here and there), we potentially duplicate cache entries in the case where both
Model.find_by(id: 1) are called, this results in two entries in the cache, with the respective keys
I was playing with it and wrote a small patch that prevents that by extracting the first (and only) value from the array of keys, if there’s only one key, in the find_by case.