1. 06 3月, 2018 1 次提交
    • F
      Fix dependence on has_one/belongs_to relationships · a286c32c
      Fernando Gorodscy 提交于
      When a class has a belongs_to or has_one relationship with dependent: :destroy
      option enabled, objects of this class should not be deleted if it's dependents
      cannot be deleted.
      
      Example:
      
          class Parent
            has_one :child, dependent: :destroy
          end
      
          class Child
            belongs_to :parent, inverse_of: :child
            before_destroy { throw :abort }
          end
      
          c = Child.create
          p = Parent.create(child: c)
      
          p.destroy
      
          p.destroyed? # expected: false; actual: true;
      
      Fixes #32022
      a286c32c
  2. 04 3月, 2018 2 次提交
  3. 26 2月, 2018 2 次提交
  4. 18 2月, 2018 3 次提交
    • R
      Make `reflection.klass` raise if `polymorphic?` not to be misused · fb86ecd6
      Ryuta Kamizono 提交于
      This is an alternative of #31877 to fix #31876 caused by #28808.
      
      This issue was caused by a combination of several loose implementation.
      
      * finding automatic inverse association of polymorphic without context (caused by #28808)
      * returning `klass` even if `polymorphic?` (exists before #28808)
      * loose verification by `valid_inverse_reflection?` (exists before #28808)
      
      This makes `klass` raise if `polymorphic?` not to be misused.
      This issue will not happen unless polymorphic `klass` is misused.
      
      Fixes #31876.
      Closes #31877.
      fb86ecd6
    • R
      Association scope's own order should be prioritized over through scope's order · 5c6d6fd3
      Ryuta Kamizono 提交于
      3acc5d6e was changed the order of scope evaluation from through scope to
      the association's own scope to be prioritized over the through scope.
      But the sorting order will be prioritized that is evaluated first. It is
      unintentional effect, association scope's sorting order should be
      prioritized as well.
      
      Fixes #32008.
      5c6d6fd3
    • E
      Deprecate update_attributes and update_attributes! · 5645149d
      Eddie Lebow 提交于
      Closes #31998
      5645149d
  5. 08 2月, 2018 1 次提交
  6. 26 1月, 2018 4 次提交
  7. 23 1月, 2018 1 次提交
  8. 15 1月, 2018 1 次提交
  9. 10 1月, 2018 1 次提交
  10. 04 1月, 2018 1 次提交
    • R
      Fix newly added reflection order when redefining association · 652258e4
      Ryuta Kamizono 提交于
      Currently reflections keeps the order when first added even if when
      redefining association. As a result of the order, redefining through
      association which use newly added association will raise
      `HasManyThroughOrderError`. We need to redefine reflection order as well
      when redefining association.
      
      Fixes #31068.
      652258e4
  11. 01 1月, 2018 1 次提交
  12. 27 12月, 2017 1 次提交
  13. 14 12月, 2017 1 次提交
  14. 12 12月, 2017 1 次提交
  15. 27 11月, 2017 1 次提交
  16. 26 11月, 2017 1 次提交
  17. 09 11月, 2017 4 次提交
  18. 06 11月, 2017 2 次提交
  19. 30 10月, 2017 1 次提交
  20. 27 10月, 2017 4 次提交
  21. 24 10月, 2017 2 次提交
  22. 23 10月, 2017 2 次提交
  23. 15 10月, 2017 1 次提交
  24. 14 10月, 2017 1 次提交