1. 26 1月, 2015 1 次提交
  2. 30 12月, 2014 1 次提交
  3. 29 11月, 2014 1 次提交
  4. 14 11月, 2014 1 次提交
  5. 09 9月, 2014 1 次提交
    • Y
      Allow included modules to override association methods. · d5580b91
      Yves Senn 提交于
      Closes #16684.
      
      This is achieved by always generating `GeneratedAssociationMethods` when
      `ActiveRecord::Base` is subclassed. When some of the included modules
      of `ActiveRecord::Base` were reordered this behavior was broken as
      `Core#initialize_generated_modules` was no longer called. Meaning that
      the module was generated on first access.
      d5580b91
  6. 05 9月, 2014 1 次提交
  7. 22 1月, 2014 1 次提交
  8. 01 8月, 2013 1 次提交
  9. 20 5月, 2013 1 次提交
  10. 10 5月, 2013 1 次提交
    • J
      Set the inverse when association queries are refined · d7abe91c
      Jon Leighton 提交于
      Suppose Man has_many interests, and inverse_of is used.
      
      Man.first.interests.first.man will correctly execute two queries,
      avoiding the need for a third query when Interest#man is called. This is
      because CollectionAssociation#first calls set_inverse_instance.
      
      However Man.first.interests.where("1=1").first.man will execute three
      queries, even though this is obviously a subset of the records in the
      association.
      
      This is because calling where("1=1") spawns a new Relation object from
      the CollectionProxy object, and the Relation has no knowledge of the
      association, so it cannot set the inverse instance.
      
      This commit solves the problem by making relations spawned from
      CollectionProxies return a new Relation subclass called
      AssociationRelation, which does know about associations. Records loaded
      from this class will get the inverse instance set properly.
      
      Fixes #5717.
      
      Live commit from La Conf! 
      d7abe91c
  11. 06 4月, 2013 1 次提交
  12. 15 3月, 2013 1 次提交
  13. 14 3月, 2013 1 次提交
  14. 02 3月, 2013 1 次提交
    • Y
      deal with `#append` and `#prepend` on association collections. · b9399c47
      Yves Senn 提交于
      Closes #7364.
      
      Collection associations behave similar to Arrays. However there is no
      way to prepend records. And to append one should use `<<`. Before this
      patch `#append` and `#prepend` did not add the record to the loaded
      association.
      
      `#append` now behaves like `<<` and `#prepend` is not defined.
      b9399c47
  15. 29 11月, 2012 1 次提交
  16. 02 8月, 2012 1 次提交
    • J
      Add CollectionProxy#scope · 0e1cafcb
      Jon Leighton 提交于
      This can be used to get a Relation from an association.
      
      Previously we had a #scoped method, but we're deprecating that for
      AR::Base, so it doesn't make sense to have it here.
      
      This was requested by DHH, to facilitate code like this:
      
          Project.scope.order('created_at DESC').page(current_page).tagged_with(@tag).limit(5).scoping do
            @topics      = @project.topics.scope
            @todolists   = @project.todolists.scope
            @attachments = @project.attachments.scope
            @documents   = @project.documents.scope
          end
      0e1cafcb
  17. 28 7月, 2012 2 次提交
  18. 25 7月, 2012 1 次提交
  19. 27 4月, 2012 3 次提交
  20. 17 1月, 2012 2 次提交
  21. 29 12月, 2011 1 次提交
  22. 30 11月, 2011 1 次提交
  23. 16 11月, 2011 2 次提交
    • J
      add test for super-ing to association methods · 9cdf33af
      Josh Susser 提交于
      9cdf33af
    • 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
  24. 14 8月, 2011 1 次提交
  25. 27 7月, 2011 1 次提交
  26. 07 6月, 2011 1 次提交
  27. 05 6月, 2011 1 次提交
    • J
      Refactor Active Record test connection setup. Please see the... · 253bb6b9
      Jon Leighton 提交于
      Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
      253bb6b9
  28. 25 5月, 2011 1 次提交
  29. 20 5月, 2011 1 次提交
  30. 11 5月, 2011 1 次提交
  31. 28 3月, 2011 2 次提交
  32. 26 3月, 2011 1 次提交
  33. 19 2月, 2011 1 次提交
  34. 18 2月, 2011 1 次提交