1. 13 5月, 2016 1 次提交
  2. 06 4月, 2016 1 次提交
    • L
      Fix undefined method `owners' for NullPreloader:Class · cb4f6875
      Ladislav Smola 提交于
      * Fix undefined method `owners' for NullPreloader:Class
      
      Fixing undefined method `owners' for
      ActiveRecord::Associations::Preloader::NullPreloader:Class
      
      * Use Ruby 1.9 hash format
      
      Use Ruby 1.9 hash format
      
      #24192
      
      [Rafael Mendonça França + Ladislav Smola]
      cb4f6875
  3. 03 2月, 2016 1 次提交
  4. 26 8月, 2015 1 次提交
  5. 13 8月, 2015 1 次提交
  6. 17 7月, 2015 1 次提交
    • P
      Silence deprecation warning from force reload · b5b89796
      Prem Sichanugrist 提交于
      We deprecate the support for passing an argument to force reload in
      6eae366d. That led to several
      deprecation warning when running Active Record test suite.
      
      This commit silence the warnings by properly calling `#reload` on the
      association proxy or on the association object instead. However, there
      are several places that `ActiveSupport::Deprecation.silence` are used as
      those tests actually tests the force reload functionality and will be
      removed once `master` is targeted next minor release (5.1).
      b5b89796
  7. 16 7月, 2015 1 次提交
    • P
      Deprecate force association reload by passing true · 6eae366d
      Prem Sichanugrist 提交于
      This is to simplify the association API, as you can call `reload` on the
      association proxy or the parent object to get the same result.
      
      For collection association, you can call `#reload` on association proxy
      to force a reload:
      
          @user.posts.reload   # Instead of @user.posts(true)
      
      For singular association, you can call `#reload` on the parent object to
      clear its association cache then call the association method:
      
          @user.reload.profile   # Instead of @user.profile(true)
      
      Passing a truthy argument to force association to reload will be removed
      in Rails 5.1.
      6eae366d
  8. 01 7月, 2015 1 次提交
    • S
      Correct through associations using scopes · bc6ac860
      Sean Griffin 提交于
      The changes introduced to through associations in c80487eb were quite
      interesting. Changing `relation.merge!(scope)` to `relation =
      relation.merge(scope)` should in theory never cause any changes in
      behavior. The subtle breakage led to a surprising conclusion.
      
      The old code wasn't doing anything! Since `merge!` calls
      `instance_exec` when given a proc, and most scopes will look something
      like `has_many :foos, -> { where(foo: :bar) }`, if we're not capturing
      the return value, it's a no-op. However, removing the `merge` causes
      `unscope` to break.
      
      While we're merging in the rest of the chain elsewhere, we were never
      merging in `unscope` values, causing a breakage on associations where a
      default scope was being unscoped in an association scope (yuk!). This is
      subtly related to #20722, since it appears we were previously relying on
      this mutability.
      
      Fixes #20721.
      Fixes #20727.
      bc6ac860
  9. 26 5月, 2015 1 次提交
    • Y
      deprecate `Relation#uniq` use `Relation#distinct` instead. · adfab2dc
      Yves Senn 提交于
      See #9683 for the reasons we switched to `distinct`.
      
      Here is the discussion that triggered the actual deprecation #20198.
      
      `uniq`, `uniq!` and `uniq_value` are still around.
      They will be removed in the next minor release after Rails 5.
      adfab2dc
  10. 08 5月, 2015 1 次提交
    • Y
      remove duplicate test. · f1da919a
      Yves Senn 提交于
      The old `test_create_bang_returns_falsy_when_join_record_has_errors` had
      a missleading name and was a duplicate of
      `test_save_should_not_raise_exception_when_join_record_has_errors`.
      
      Since it had an assertion on the return value I renamed it accordingly
      and got rid of the duplicate test.
      f1da919a
  11. 21 4月, 2015 1 次提交
    • A
      Rename association option :class to :anonymous_class · ac2b7a5c
      Andrew White 提交于
      In 1f006c an option was added called :class to allow passing anonymous
      classes to association definitions. Since using :class instead of
      :class_name is a fairly common typo even amongst experienced developers
      this can result in hard to debug errors arising in raise_on_type_mismatch?
      
      To fix this we're renaming the option from :class to :anonymous_class as
      that is a more correct description of what the option is for. Since this
      was an internal, undocumented option there is no need for a deprecation.
      
      Fixes #19659
      ac2b7a5c
  12. 25 3月, 2015 1 次提交
    • C
      DRY up STI subclass logic · 7c0f8c64
      Cody Cutrer 提交于
      the newer method used for discriminating new records did not
      use the older and more robust method used for instantiating
      existing records, but did have a better post-check to ensure
      the sublass was in the hierarchy. so move the descendants check
      to find_sti_class, and then simply call find_sti_class from
      subclass_from_attributes
      
      now with fixed specs
      7c0f8c64
  13. 27 2月, 2015 1 次提交
    • S
      Properly create through records when called with `where` · 38218929
      Sean Griffin 提交于
      Various behaviors needed by associations (such as creating the through
      record) are lost when `where` is called, since we stop having a
      `CollectionProxy` and start having an `AssociationRelation` which does
      not contain this behavior. I *think* we should be able to rm
      `AssociationRelation`, but we have tests saying the changes required to
      do that would be bad (Without saying why. Of course. >_>)
      
      Fixes #19073.
      38218929
  14. 29 11月, 2014 1 次提交
  15. 28 11月, 2014 1 次提交
  16. 14 11月, 2014 1 次提交
  17. 06 9月, 2014 1 次提交
  18. 28 8月, 2014 1 次提交
  19. 26 6月, 2014 1 次提交
    • S
      Deprecate automatic counter caches on has_many :through · d730e374
      Sean Griffin 提交于
      Reliant on https://github.com/rails/rails/pull/15747 but pulled to a
      separate PR to reduce noise. `has_many :through` associations have the
      undocumented behavior of automatically detecting counter caches.
      However, the way in which it does so is inconsistent with counter caches
      everywhere else, and doesn't actually work consistently.
      
      As with normal `has_many` associations, the user should specify the
      counter cache on the `belongs_to`, if they'd like it updated.
      d730e374
  20. 18 6月, 2014 2 次提交
  21. 14 6月, 2014 1 次提交
  22. 25 5月, 2014 1 次提交
  23. 29 4月, 2014 1 次提交
  24. 23 4月, 2014 2 次提交
  25. 03 4月, 2014 1 次提交
  26. 20 2月, 2014 1 次提交
  27. 17 11月, 2013 1 次提交
  28. 12 11月, 2013 1 次提交
  29. 28 10月, 2013 2 次提交
  30. 09 10月, 2013 1 次提交
  31. 28 9月, 2013 1 次提交
  32. 25 9月, 2013 1 次提交
  33. 24 9月, 2013 3 次提交
  34. 12 9月, 2013 1 次提交
  35. 07 9月, 2013 1 次提交