1. 26 7月, 2016 2 次提交
  2. 25 7月, 2016 1 次提交
  3. 24 7月, 2016 1 次提交
  4. 20 7月, 2016 1 次提交
  5. 18 7月, 2016 1 次提交
  6. 10 7月, 2016 1 次提交
  7. 02 7月, 2016 1 次提交
  8. 13 6月, 2016 1 次提交
  9. 09 6月, 2016 1 次提交
  10. 31 5月, 2016 1 次提交
    • S
      Exists shouldn't error when used with `includes` · 02da8aea
      Sean Griffin 提交于
      Currently `exists?` does some hackery where it assumes that we can join
      onto anything that we passed to `eager_load` or `includes`, which
      doesn't work if we are joining onto a polymorphic association.
      
      Actually figuring out if we want to include something would require
      knowledge deep within the join dependency module, which is hard to pull
      up. The simplest solution is just to pass a flag down that says we're
      not actually going to try to eager load any of the data. It's not the
      solution I'd like, but that code really needs to be untangled before we
      can do much with it.
      
      This is another attempt at 6d5b1fdf which should address the concerns
      that led to reverting it in 4ecabed2.
      02da8aea
  11. 27 5月, 2016 1 次提交
  12. 19 5月, 2016 1 次提交
  13. 13 5月, 2016 2 次提交
  14. 29 4月, 2016 1 次提交
  15. 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
  16. 03 3月, 2016 1 次提交
  17. 02 3月, 2016 1 次提交
  18. 01 3月, 2016 1 次提交
    • S
      Respect through association scopes when used with polymorphic · af2c427c
      Sean Griffin 提交于
      When the `source_type` option is passed to a has_many through, the
      resulting `Reflection` will be an instance of `PolymorphicReflection`
      and not `ThroughReflection`, meaning that it will ignore the scopes that
      it needs to apply from the through reflections. This adds an additional
      delegation call to remedy this. I've been finding the reflection code
      completely impenetrable lately, it could use some major love.
      
      Fixes #22726
      af2c427c
  19. 23 2月, 2016 1 次提交
  20. 20 2月, 2016 2 次提交
  21. 11 2月, 2016 1 次提交
  22. 10 2月, 2016 1 次提交
  23. 04 2月, 2016 1 次提交
  24. 03 2月, 2016 2 次提交
  25. 28 1月, 2016 1 次提交
  26. 21 12月, 2015 1 次提交
    • Y
      Revert "Merge pull request #22486 from methyl/fix-includes-for-groupped-association" · b06f6a1d
      Yves Senn 提交于
      This reverts commit 537ac7d6, reversing
      changes made to 9c9c54ab.
      
      Reason:
      The way we preload associations will change the meaning of GROUP BY
      operations. This is illustrated in the SQL generated by the added
      test (failing on PG):
      
      Association Load:
      D, [2015-12-21T12:26:07.169920 #26969] DEBUG -- :   Post Load (0.7ms)  SELECT "posts".* FROM "posts" LEFT JOIN comments ON comments.post_id = posts.id WHERE "posts"."author_id" = $1 GROUP BY posts.id ORDER BY SUM(comments.tags_count)  [["author_id", 1]]
      
      Preload:
      D, [2015-12-21T12:26:07.128305 #26969] DEBUG -- :   Post Load (1.3ms)  SELECT "posts".* FROM "posts" LEFT JOIN comments ON comments.post_id = posts.id WHERE "posts"."author_id" IN (1, 2, 3) GROUP BY posts.id ORDER BY SUM(comments.tags_count)
      b06f6a1d
  27. 17 12月, 2015 1 次提交
  28. 16 12月, 2015 1 次提交
  29. 23 11月, 2015 1 次提交
  30. 16 11月, 2015 1 次提交
    • Y
      Except keys of `build_record`'s argument from `create_scope` in initialize_attributes · 817c1825
      yui-knk 提交于
      If argument of `build_record` has key and value which is same as
      default value of database, we should also except the key from
      `create_scope` in `initialize_attributes`.
      Because at first `build_record` initialize record object with argument
      of `build_record`, then assign attributes derived from Association's scope.
      In this case `record.changed` does not include the key, which value is
      same as default value of database, so we should add the key to except list.
      
      Fix #21893.
      817c1825
  31. 31 10月, 2015 2 次提交
  32. 30 10月, 2015 4 次提交
    • S
      Ensure `has_and_belongs_to_many` works with `belongs_to_required_by_default` · 21a386bb
      Sean Griffin 提交于
      Before this commit, if
      `ActiveRecord::Base.belongs_to_required_by_default` is set to `true`,
      then creating a record through `has_and_belongs_to_many` fails with the
      cryptic error message `Left side must exist`. This is because
      `inverse_of` isn't working properly in this case, presumably since we're
      doing trickery with anonymous classes in the middle.
      
      Rather than following this rabbit hole to try and get `inverse_of` to
      work in a case that we know is not publicly supported, we can just turn
      off this validation to match the behavior of 4.2 and earlier.
      21a386bb
    • S
      Never pass `nil` to `order` · a59a4fbd
      Sean Griffin 提交于
      This is part of a refactoring to make it easier to allow `order` to use
      sanitize like just about everything else on relation. The deleted test
      doesn't give any reasoning as to why passing `nil` to `order` needs to
      be supported, and it's rather nonsensical. I can almost see allowing an
      empty string being passed (though I'm tempted to just disallow it...)
      a59a4fbd
    • Y
      Revert "Revert "Merge pull request #22026 from akihiro17/fix-preload-association"" · 857a34a4
      Yves Senn 提交于
      This reverts commit 52439460.
      
      This fixes an issue with the build where tests would fail on mysql and
      postgresql due to different ordering.
      857a34a4
    • S
      Revert "Merge pull request #22026 from akihiro17/fix-preload-association" · 52439460
      Sean Griffin 提交于
      This reverts commit 6dc6a0b1, reversing
      changes made to ec94f00b.
      
      This pull request broke the build.
      52439460