1. 29 11月, 2012 1 次提交
    • J
      Added STI support to init and building associations · 89b5b31c
      Jason Rush 提交于
      Allows you to do BaseClass.new(:type => "SubClass") as well as
      parent.children.build(:type => "SubClass") or parent.build_child
      to initialize an STI subclass. Ensures that the class name is a
      valid class and that it is in the ancestors of the super class
      that the association is expecting.
      89b5b31c
  2. 17 9月, 2012 1 次提交
  3. 04 9月, 2012 1 次提交
  4. 11 8月, 2012 1 次提交
    • J
      Remove the dependent_restrict_raises option. · 5ad79989
      Jon Leighton 提交于
      It's not really a good idea to have this as a global config option. We
      should allow people to specify the behaviour per association.
      
      There will now be two new values:
      
      * :dependent => :restrict_with_exception implements the current
        behaviour of :restrict. :restrict itself is deprecated in favour of
        :restrict_with_exception.
      * :dependent => :restrict_with_error implements the new behaviour - it
        adds an error to the owner if there are dependent records present
      
      See #4727 for the original discussion of this.
      5ad79989
  5. 02 8月, 2012 2 次提交
  6. 21 7月, 2012 1 次提交
  7. 20 7月, 2012 1 次提交
  8. 03 5月, 2012 1 次提交
  9. 01 2月, 2012 1 次提交
  10. 31 1月, 2012 1 次提交
  11. 17 1月, 2012 1 次提交
  12. 30 11月, 2011 1 次提交
  13. 04 11月, 2011 1 次提交
  14. 13 6月, 2011 1 次提交
  15. 14 2月, 2011 1 次提交
  16. 17 1月, 2011 2 次提交
  17. 08 1月, 2011 1 次提交
  18. 04 1月, 2011 1 次提交
    • J
      Allow assignment on has_one :through where the owner is a new record [#5137 state:resolved] · a0be389d
      Jon Leighton 提交于
      This required changing the code to keep the association proxy for a belongs_to around, despite its target being nil. Which in turn required various changes to the way that stale target checking is handled, in order to support various edge cases (loaded target is nil then foreign key added, foreign key is changed and then changed back, etc). A side effect is that the code is nicer and more succinct.
      
      Note that I am removing test_no_unexpected_aliasing since that is basically checking that the proxy for a belongs_to *does* change, which is the exact opposite of the intention of this commit. Also adding various tests for various edge cases and related things.
      
      Phew, long commit message!
      a0be389d
  19. 01 1月, 2011 1 次提交
  20. 31 10月, 2010 1 次提交
  21. 28 3月, 2010 1 次提交
  22. 09 3月, 2010 1 次提交
  23. 19 1月, 2010 1 次提交
  24. 10 11月, 2009 1 次提交
  25. 28 9月, 2009 1 次提交
  26. 12 9月, 2009 2 次提交
  27. 08 9月, 2009 1 次提交
  28. 10 8月, 2009 1 次提交
  29. 07 8月, 2009 1 次提交
  30. 16 7月, 2009 1 次提交
  31. 01 7月, 2009 1 次提交
  32. 23 6月, 2009 1 次提交
  33. 22 6月, 2009 1 次提交
  34. 21 4月, 2009 1 次提交
  35. 22 3月, 2009 1 次提交
  36. 09 3月, 2009 1 次提交
  37. 07 3月, 2009 1 次提交