1. 29 5月, 2019 1 次提交
  2. 26 3月, 2019 1 次提交
    • Y
      Use `assert_queries(0)` instead of `assert_no_queries` to ignore metadata queries · 4dd3b2bd
      Yasuo Honda 提交于
      Fix #35665
      
      ```ruby
      $ ARCONN=mysql2 bin/test test/cases/scoping/named_scoping_test.rb test/cases/tasks/database_tasks_test.rb test/cases/associations/cascaded_eager_loading_test.rb test/cases/associations/eager_singularization_test.rb -n "/^(?:NamedScopingTest#(?:test_many_should_not_fire_query_if_scope_loaded)|ActiveRecord::DatabaseTasksDumpSchemaCacheTest#(?:test_dump_schema_cache)|CascadedEagerLoadingTest#(?:test_eager_association_loading_with_has_many_sti_and_subclasses)|EagerSingularizationTest#(?:test_eager_no_extra_singularization_has_many_through_belongs_to))$/" --seed 16818
      Using mysql2
      Run options: -n "/^(?:NamedScopingTest#(?:test_many_should_not_fire_query_if_scope_loaded)|ActiveRecord::DatabaseTasksDumpSchemaCacheTest#(?:test_dump_schema_cache)|CascadedEagerLoadingTest#(?:test_eager_association_loading_with_has_many_sti_and_subclasses)|EagerSingularizationTest#(?:test_eager_no_extra_singularization_has_many_through_belongs_to))$/" --seed 16818
      
      ...F
      
      Failure:
      CascadedEagerLoadingTest#test_eager_association_loading_with_has_many_sti_and_subclasses [/home/yahonda/git/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb:124]:
      1 instead of 0 queries were executed.
      Queries:
      SHOW FULL FIELDS FROM `topics`.
      Expected: 0
        Actual: 1
      
      bin/test test/cases/associations/cascaded_eager_loading_test.rb:119
      
      Finished in 6.894609s, 0.5802 runs/s, 1.0153 assertions/s.
      4 runs, 7 assertions, 1 failures, 0 errors, 0 skips
      $
      ```
      4dd3b2bd
  3. 10 2月, 2019 1 次提交
  4. 04 10月, 2018 1 次提交
  5. 02 10月, 2018 1 次提交
  6. 19 9月, 2018 1 次提交
    • R
      Avoid the same `foreign_key` and `counter_cache` associations on `SillyReply` · afea2739
      Ryuta Kamizono 提交于
      `topic` and `reply` belongs_to associations on `SillyReply` are defined
      with the same `foreign_key` (`parent_id`) and `counter_cache`
      (`replies_count`) columns.
      This would cause unintentional side-effect (e.g. saving `SillyReply`
      object would cause double increment `replies_count`), so it is better to
      avoid that side-effect.
      afea2739
  7. 12 12月, 2017 1 次提交
  8. 09 11月, 2017 4 次提交
  9. 20 7月, 2017 1 次提交
  10. 02 7月, 2017 1 次提交
  11. 01 7月, 2017 1 次提交
  12. 06 6月, 2017 1 次提交
  13. 27 4月, 2017 2 次提交
  14. 26 3月, 2017 1 次提交
  15. 04 1月, 2017 1 次提交
  16. 03 12月, 2016 1 次提交
  17. 29 10月, 2016 1 次提交
  18. 17 9月, 2016 1 次提交
  19. 16 8月, 2016 1 次提交
  20. 07 8月, 2016 2 次提交
  21. 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
  22. 02 1月, 2014 1 次提交
  23. 31 12月, 2013 1 次提交
    • V
      https://github.com/rails/rails/commit/2075f39d726cef361170218fd16421fc52bed5a8... · bb17c3b2
      Vipul A M 提交于
      https://github.com/rails/rails/commit/2075f39d726cef361170218fd16421fc52bed5a8 introduced a regression in includes/preloades
      by calling `read_attribute` on an association when preloading takes places, instead of using loaded records in `association.target`.
      
      tl;dr
      
      Records are not made properly available via `read_attribute` when preloding in simultaneous,
      but value of `@loaded` is already set true, and records concatenated in `association.target` on an association object.
      When `@loaded` is true we return an object of `AlreadyLoaded` in preload_for. In `AlreadyLoaded` to return preloaded
      records we make wrong use of `read_attribute`, instead of `target` records.
      
      The regression is fixed by making use of the loaded records in `association.target` when the preloading takes place.
      
      Fixes #13437
      bb17c3b2
  24. 28 8月, 2013 1 次提交
  25. 15 3月, 2013 1 次提交
    • Y
      Deprecate the `:distinct` option for `Relation#count`. · cd87c85e
      Yves Senn 提交于
      We moved more and more away from passing options to finder / calculation
      methods. The `:distinct` option in `#count` was one of the remaining places.
      Since we can now combine `Relation#distinct` with `Relation#count` the option
      is no longer necessary and can be deprecated.
      cd87c85e
  26. 28 7月, 2012 1 次提交
  27. 27 7月, 2012 1 次提交
    • J
      ActiveRecord::Base.all returns a Relation. · 6a81ccd6
      Jon Leighton 提交于
      Previously it returned an Array.
      
      If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This
      is more explicit.
      
      In most cases this should not break existing code, since
      Relations use method_missing to delegate unknown methods to #to_a
      anyway.
      6a81ccd6
  28. 27 4月, 2012 2 次提交
  29. 17 1月, 2012 2 次提交
  30. 29 12月, 2011 1 次提交
  31. 07 6月, 2011 1 次提交
  32. 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
  33. 31 5月, 2011 1 次提交