1. 11 2月, 2016 1 次提交
  2. 10 2月, 2016 1 次提交
  3. 04 2月, 2016 1 次提交
  4. 03 2月, 2016 1 次提交
  5. 31 1月, 2016 1 次提交
  6. 25 1月, 2016 1 次提交
  7. 18 1月, 2016 1 次提交
  8. 14 1月, 2016 1 次提交
  9. 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
  10. 16 12月, 2015 1 次提交
  11. 07 12月, 2015 1 次提交
    • A
      Make sure we touch all the parents when touch_later. · e7c48db5
      Arthur Neves 提交于
      The problem was that when saving an object, we would
      call touch_later on the parent which wont be saved immediteally, and
      it wont call any callbacks. That was working one level up because
      we were calling touch, during the touch_later commit phase. However that still
      didnt solve the problem when you have a 3+ levels of parents to be touched,
      as calling touch would affect the parent, but it would be too late to run callbacks
      on its grand-parent.
      
      The solution for this, is instead, call touch_later upwards when the first
      touch_later is called. So we make sure all the timestamps are updated without relying
      on callbacks.
      
      This also removed the hard dependency BelongsTo builder had with the TouchLater module.
      So we can still have the old behaviour if TouchLater module is not included.
      
      [fixes 5f5e6d92]
      [related #19324]
      e7c48db5
  12. 23 11月, 2015 1 次提交
  13. 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
  14. 08 11月, 2015 2 次提交
  15. 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
  16. 29 10月, 2015 1 次提交
  17. 27 10月, 2015 4 次提交
  18. 22 10月, 2015 1 次提交
  19. 21 10月, 2015 1 次提交
  20. 20 10月, 2015 1 次提交
  21. 19 10月, 2015 1 次提交
    • J
      Reorder application of has_many association constraints. · d9bb13ba
      jbranchaud 提交于
      With `unscope!` called last, it undoes `where` constraints of the same
      value when the `where` is chained after the `unscope`. This is what a
      `rewhere` does. This is undesirable behavior.
      
      The included tests demonstrate both the `unscope(...).where(...)`
      behavior as well as the direct use of `rewhere(...)`.
      
      This is in reference to #21955.
      d9bb13ba
  22. 14 10月, 2015 2 次提交
    • Y
      applies new doc guidelines to Active Record. · 428d47ad
      Yves Senn 提交于
      The focus of this change is to make the API more accessible.
      References to method and classes should be linked to make it easy to
      navigate around.
      
      This patch makes exzessiv use of `rdoc-ref:` to provide more readable
      docs. This makes it possible to document `ActiveRecord::Base#save` even
      though the method is within a separate module
      `ActiveRecord::Persistence`. The goal here is to bring the API closer to
      the actual code that you would write.
      
      This commit only deals with Active Record. The other gems will be
      updated accordingly but in different commits. The pass through Active
      Record is not completely finished yet. A follow up commit will change
      the spots I haven't yet had the time to update.
      
      /cc @fxn
      428d47ad
    • Y
      801371ab
  23. 13 10月, 2015 2 次提交
  24. 05 10月, 2015 1 次提交
  25. 29 9月, 2015 1 次提交
  26. 27 9月, 2015 1 次提交
  27. 25 9月, 2015 1 次提交
    • S
      Clean up the implementation of AR::Dirty · 8e633e50
      Sean Griffin 提交于
      This moves a bit more of the logic required for dirty checking into the
      attribute objects. I had hoped to remove the `with_value_from_database`
      stuff, but unfortunately just calling `dup` on the attribute objects
      isn't enough, since the values might contain deeply nested data
      structures. I think this can be cleaned up further.
      
      This makes most dirty checking become lazy, and reduces the number of
      object allocations and amount of CPU time when assigning a value. This
      opens the door (but doesn't quite finish) to improving the performance
      of writes to a place comparable to 4.1
      8e633e50
  28. 17 9月, 2015 1 次提交
  29. 12 9月, 2015 1 次提交
  30. 10 9月, 2015 1 次提交
  31. 09 9月, 2015 1 次提交