1. 12 6月, 2013 1 次提交
  2. 20 5月, 2013 1 次提交
  3. 15 5月, 2013 3 次提交
  4. 29 11月, 2012 1 次提交
  5. 11 8月, 2012 6 次提交
    • J
      Use method compilation for association methods · 6e57d5c5
      Jon Leighton 提交于
      Method compilation provides better performance and I think the code
      comes out cleaner as well.
      
      A knock on effect is that methods that get redefined produce warnings. I
      think this is a good thing. I had to deal with a bunch of warnings
      coming from our tests, though.
      6e57d5c5
    • J
      DRY up handling of dependent option · 6bb8afb4
      Jon Leighton 提交于
      6bb8afb4
    • J
      Unprivatise all the things · 825c05d4
      Jon Leighton 提交于
      Well, not all of them, but some of them.
      
      I don't think there's much reason for these methods to be private.
      825c05d4
    • J
      move dependency logic out of generated methods · ea8181b6
      Jon Leighton 提交于
      ea8181b6
    • J
      Clean up dependent option validation. · 08fb3c8f
      Jon Leighton 提交于
      We don't need the complexity of to_sentence, and it shouldn't be a bang
      method.
      08fb3c8f
    • 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
  6. 01 8月, 2012 2 次提交
  7. 20 7月, 2012 1 次提交
  8. 14 7月, 2012 4 次提交
  9. 13 7月, 2012 2 次提交
  10. 02 2月, 2012 3 次提交
  11. 01 2月, 2012 2 次提交
  12. 31 1月, 2012 2 次提交
  13. 29 1月, 2012 1 次提交
  14. 17 1月, 2012 2 次提交
  15. 29 12月, 2011 1 次提交
  16. 28 11月, 2011 2 次提交
    • J
      avoid warnings · 124c97fb
      Josh Susser 提交于
      This change uses Module.redefine_method as defined in ActiveSupport.
      Making Module.define_method public would be as clean in the code, and
      would also emit warnings when redefining an association. That is pretty
      messy given current tests, so I'm leaving it for someone else to decide
      what approach is better.
      124c97fb
    • J
      use GeneratedFeatureMethods module for associations · 61bcc318
      Josh Susser 提交于
      61bcc318
  17. 16 11月, 2011 1 次提交
    • J
      association methods are now generated in modules · 7cba6a37
      Josh Susser 提交于
      Instead of generating association methods directly in the model
      class, they are generated in an anonymous module which
      is then included in the model class. There is one such module
      for each association. The only subtlety is that the
      generated_attributes_methods module (from ActiveModel) must
      be forced to be included before association methods are created
      so that attribute methods will not shadow association methods.
      7cba6a37
  18. 22 2月, 2011 1 次提交