1. 02 7月, 2017 1 次提交
  2. 01 7月, 2017 1 次提交
  3. 22 6月, 2017 1 次提交
  4. 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
  5. 28 5月, 2017 2 次提交
  6. 22 4月, 2017 1 次提交
  7. 23 3月, 2017 1 次提交
  8. 20 3月, 2017 1 次提交
  9. 09 3月, 2017 1 次提交
  10. 01 3月, 2017 1 次提交
  11. 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
  12. 21 2月, 2017 1 次提交
  13. 29 12月, 2016 1 次提交
  14. 25 12月, 2016 2 次提交
  15. 24 12月, 2016 1 次提交
  16. 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
  17. 22 10月, 2016 1 次提交
  18. 07 9月, 2016 2 次提交
  19. 04 9月, 2016 1 次提交
  20. 19 8月, 2016 2 次提交
  21. 18 8月, 2016 2 次提交
  22. 16 8月, 2016 1 次提交
  23. 14 8月, 2016 1 次提交
  24. 04 8月, 2016 1 次提交
  25. 28 7月, 2016 1 次提交
  26. 24 7月, 2016 1 次提交
  27. 20 7月, 2016 1 次提交
  28. 15 7月, 2016 1 次提交
  29. 19 5月, 2016 1 次提交
  30. 20 3月, 2016 1 次提交
  31. 21 2月, 2016 1 次提交
  32. 11 2月, 2016 1 次提交
  33. 10 2月, 2016 1 次提交
  34. 14 10月, 2015 2 次提交
    • Y
      applies new doc guidelines to Active Record. · 428d47ad
      Yves Senn 提交于
      The focus of this change is to make the API more accessible.
      References to method and classes should be linked to make it easy to
      navigate around.
      
      This patch makes exzessiv use of `rdoc-ref:` to provide more readable
      docs. This makes it possible to document `ActiveRecord::Base#save` even
      though the method is within a separate module
      `ActiveRecord::Persistence`. The goal here is to bring the API closer to
      the actual code that you would write.
      
      This commit only deals with Active Record. The other gems will be
      updated accordingly but in different commits. The pass through Active
      Record is not completely finished yet. A follow up commit will change
      the spots I haven't yet had the time to update.
      
      /cc @fxn
      428d47ad
    • Y
      801371ab