• X
    Revert "Convert StrongParameters cache to a hash. This fixes an unbounded" · 1ecada20
    Xavier Noria 提交于
    We cannot cache keys because arrays are mutable. We rather want to cache
    the arrays. This behaviour is tailor-made for the usage pattern strongs
    params is designed for.
    
    In a forthcoming commit I am going to add a test that covers why we need
    to cache by value.
    
    Every strong params instance has a live span of a request, the cache goes
    away with the object. Since strong params have such a concrete intention,
    it would be interesting to see if there are actually any real-world use
    cases that are an actual leak, one that practically may matter.
    
    I am not convinced that the theoretical leak has any practical consequences,
    but if it can be shown there are, then I believe we should either get rid of
    the cache (which is an optimization), or else wipe it in the mutating API.
    
    This reverts commit e63be276.
    1ecada20
strong_parameters.rb 19.2 KB