1. 10 11月, 2017 1 次提交
  2. 16 10月, 2017 1 次提交
  3. 13 8月, 2017 1 次提交
  4. 20 7月, 2017 1 次提交
  5. 02 7月, 2017 1 次提交
  6. 01 7月, 2017 1 次提交
  7. 22 6月, 2017 1 次提交
  8. 21 6月, 2017 1 次提交
    • 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
  9. 28 5月, 2017 2 次提交
  10. 22 4月, 2017 1 次提交
  11. 23 3月, 2017 1 次提交
  12. 20 3月, 2017 1 次提交
  13. 09 3月, 2017 1 次提交
  14. 01 3月, 2017 1 次提交
  15. 28 2月, 2017 1 次提交
    • E
      Dupping a CollectionProxy should dup the load_target · ca8c21df
      eileencodes 提交于
      In Rails 3.2 dupping a `CollectionProxy` would dup it's `load_target` as
      well. That functionality has been broken since the release of Rails 4.0.
      I hit this in an application upgrade and wondered why duplicating a
      CollectionProxy and assigning it to a variable stopped working.
      
      When calling `dup` on a `CollectionProxy` only the owner (ex.
      topic) was getting duplicated and the `load_target` would remain in tact
      with it's original object ID. Dupping the `load_target` is useful for performing
      a logging operation after records have been destroyed in a method.
      
      For example:
      
      ```
      def transfer_operation
        saved_replies = topic.replies
      
        topic.replies.clear
      
        saved_replies.each do |reply|
          user.update_replies_count!
        end
      end
      ```
      
      This change adds a `initialize_dup` method that performs a `deep_dup` on
      the `@associatiation` so that the `load_target` is dupped as well.
      
      Fixes #17117
      ca8c21df
  16. 21 2月, 2017 1 次提交
  17. 29 12月, 2016 1 次提交
  18. 25 12月, 2016 2 次提交
  19. 24 12月, 2016 1 次提交
  20. 13 11月, 2016 1 次提交
    • R
      Respect new records for `CollectionProxy#uniq` · 0ec967aa
      Ryuta Kamizono 提交于
      Currently if `CollectionProxy` has more than one new record,
      `CollectionProxy#uniq` result is incorrect.
      
      And `CollectionProxy#uniq` was aliased to `distinct` in a1bb6c8b.
      But the `uniq` method and the `SELECT DISTINCT` method are different
      methods. The doc in `CollectionProxy` is for the `SELECT DISTINCT`
      method, not for the `uniq` method.
      
      Therefore, reverting the alias in `CollectionProxy` to fix the
      inconsistency and to have the both methods.
      0ec967aa
  21. 22 10月, 2016 1 次提交
  22. 07 9月, 2016 2 次提交
  23. 04 9月, 2016 1 次提交
  24. 19 8月, 2016 2 次提交
  25. 18 8月, 2016 2 次提交
  26. 16 8月, 2016 1 次提交
  27. 14 8月, 2016 1 次提交
  28. 04 8月, 2016 1 次提交
  29. 28 7月, 2016 1 次提交
  30. 24 7月, 2016 1 次提交
  31. 20 7月, 2016 1 次提交
  32. 15 7月, 2016 1 次提交
  33. 19 5月, 2016 1 次提交
  34. 20 3月, 2016 1 次提交
  35. 21 2月, 2016 1 次提交