• J
    Clear offset cache on CollectionProxy reset/reload · c7f669af
    John Hawthorn 提交于
    The `@offsets` cache is used by FinderMethods to cache records found by
    find_nth. This cache is cleared in AR::Relation#reset, but not in
    CollectionProxy#reset or CollectionProxy#reload.
    
    Because of this, since #29098, calling #first/#find_nth/etc after
    calling #reload or #reset on an association could return a stale record.
    This is an issue both when the full association target is loaded and
    when the item is loaded in #find_nth.
    
    This commit solves the problem by clearing the `@offsets` cache in
    CollectionProxy#reset and CollectionProxy#reload.
    c7f669af
has_many_associations_test.rb 83.0 KB