1. 13 7月, 2017 1 次提交
  2. 04 7月, 2017 2 次提交
  3. 02 7月, 2017 2 次提交
  4. 01 7月, 2017 1 次提交
  5. 30 6月, 2017 1 次提交
  6. 29 6月, 2017 4 次提交
  7. 28 6月, 2017 2 次提交
  8. 22 6月, 2017 1 次提交
  9. 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
  10. 09 6月, 2017 1 次提交
  11. 06 6月, 2017 1 次提交
  12. 01 6月, 2017 1 次提交
  13. 31 5月, 2017 1 次提交
  14. 29 5月, 2017 1 次提交
  15. 28 5月, 2017 1 次提交
    • R
      Fix association with extension issues · 9b78974b
      Ryuta Kamizono 提交于
      This fixes the following issues.
      
      * `association_scope` doesn't include `default_scope`. Should use `scope` instead.
      * We can't use `method_missing` for customizing existing method.
      * We can't use `relation_delegate_class` for sharing extensions. Should extend per association.
      9b78974b
  16. 24 5月, 2017 1 次提交
  17. 23 5月, 2017 1 次提交
  18. 21 5月, 2017 1 次提交
  19. 19 5月, 2017 1 次提交
  20. 11 5月, 2017 1 次提交
  21. 28 4月, 2017 1 次提交
  22. 27 4月, 2017 2 次提交
  23. 26 4月, 2017 1 次提交
    • R
      Remove useless test case · 111ae374
      Ryuta Kamizono 提交于
      Cannot call private methods in `@klass` against `CollectionProxy`
      (inherites `Relation`) because using `public_send` in `method_missing`.
      111ae374
  24. 22 4月, 2017 1 次提交
  25. 21 4月, 2017 2 次提交
    • I
      Don't attempt to create a new record that was already created. · b17fa0c3
      Isaac Betesh 提交于
      Fixes #24032
      b17fa0c3
    • R
      Prevent double firing the before save callback of new object when the parent... · c0038f7c
      Ryuta Kamizono 提交于
      Prevent double firing the before save callback of new object when the parent association saved in the callback
      
      Related #18155, #26661, 268a5bb0, #27434, #27442, and #28599.
      
      Originally #18155 was introduced for preventing double insertion caused
      by the after save callback. But it was caused the before save issue
      (#26661). 268a5bb0 fixed #26661, but it was caused the performance
      regression (#27434). #27442 added new record to `target` before calling
      callbacks for fixing #27434. But it was caused double firing before save
      callback (#28599). We cannot add new object to `target` before saving
      the object.
      
      This is improving #18155 to only track callbacks after `save`.
      
      Fixes #28599.
      c0038f7c
  26. 20 4月, 2017 2 次提交
  27. 26 3月, 2017 2 次提交
  28. 20 3月, 2017 1 次提交
  29. 19 3月, 2017 1 次提交
    • R
      Use `load` rather than `collect` for force loading · 59db5f22
      Ryuta Kamizono 提交于
      Since b644964b `ActiveRecord::Relation` includes `Enumerable` so
      delegating `collect`, `all?`, and `include?` are also unneeded.
      `collect` without block returns `Enumerable` without preloading by that.
      We should use `load` rather than `collect` for force loading.
      59db5f22
  30. 17 3月, 2017 1 次提交
    • G
      Add :default option to belongs_to (#28453) · 73b86ac5
      George Claghorn 提交于
      Use it to specify that an association should be initialized with a
      particular record before validation. For example:
      
          # Before
          belongs_to :account
          before_validation -> { self.account ||= Current.account }
      
          # After
          belongs_to :account, default: -> { Current.account }
      73b86ac5