1. 05 4月, 2019 6 次提交
  2. 04 4月, 2019 31 次提交
    • R
      Fix rubocop offence for `Style/FrozenStringLiteralComment` · 9e6f9bc7
      Ryuta Kamizono 提交于
      ```
      % be rubocop -a
      Inspecting 2777 files
      ..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
      
      Offenses:
      
      tools/test_common.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
      if ENV["BUILDKITE"]
      ^
      
      2777 files inspected, 1 offense detected, 1 offense corrected
      ```
      9e6f9bc7
    • K
      Merge pull request #35856 from prathamesh-sonpatki/fix-dep-warning · 4c4cc7e3
      Kasper Timm Hansen 提交于
      Fix deprecation warning about variants and formats
      4c4cc7e3
    • P
      Fix deprecation warning about variants and formats · 6a4bf486
      Prathamesh Sonpatki 提交于
      - After https://github.com/rails/rails/pull/35408 and
        https://github.com/rails/rails/pull/35406, the `formats` and
        `variants` methods are deprecated in favor of `format` and `variant`.
      6a4bf486
    • M
      Merge pull request #35698 from mtsmfm/output-test-report · fd81e83b
      Matthew Draper 提交于
      Output junit format test report
      fd81e83b
    • R
      Merge pull request #35850 from kamipo/fix_count_all_with_eager_loading_and_select_and_order · c9981ae6
      Ryuta Kamizono 提交于
      Fix `count(:all)` with eager loading and explicit select and order
      c9981ae6
    • R
      Fix `count(:all)` with eager loading and explicit select and order · 060e09df
      Ryuta Kamizono 提交于
      This follows up ebc09ed9.
      
      We've still experienced a regression for `size` (`count(:all)`) with
      eager loading and explicit select and order when upgrading Rails to 5.1.
      
      In that case, the eager loading enforces `distinct` to subselect but
      still keep the custom select, it would cause the ORDER BY with DISTINCT
      issue.
      
      ```
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/relations_test.rb -n test_size_with_eager_loading_and_custom_select_and_order
      Using postgresql
      Run options: -n test_size_with_eager_loading_and_custom_select_and_order --seed 8356
      
      # Running:
      
      E
      
      Error:
      RelationTest#test_size_with_eager_loading_and_custom_select_and_order:
      ActiveRecord::StatementInvalid: PG::InvalidColumnReference: ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
      LINE 1: ..." ON "comments"."post_id" = "posts"."id" ORDER BY comments.i...
                                                                   ^
      ```
      
      As another problem on `distinct` is enforced, the result of `count`
      becomes fewer than expected if `select` is given explicitly.
      
      e.g.
      
      ```ruby
      Post.select(:type).count
      # => 11
      
      Post.select(:type).distinct.count
      # => 3
      ```
      
      As long as `distinct` is enforced, we need to care to keep the result of
      `count`.
      
      This fixes both the `count` with eager loading problems.
      060e09df
    • F
      Output junit format test report · 61c4be47
      Fumiaki MATSUSHIMA 提交于
      61c4be47
    • S
    • R
      Merge pull request #35848 from kamipo/refactor_collection_cache_key · 39d42dbd
      Ryuta Kamizono 提交于
      Refactor `Relation#cache_key` is moved from `CollectionCacheKey#collection_cache_key`
      39d42dbd
    • R
      Refactor `Relation#cache_key` is moved from `CollectionCacheKey#collection_cache_key` · 10919bfe
      Ryuta Kamizono 提交于
      The implementation of `Relation#cache_key` depends on some internal
      relation methods (e.g. `apply_join_dependency`, `build_subquery`), but
      somehow that implementation exists on the model class
      (`collection_cache_key`), it sometimes bothers to me.
      
      This refactors that implementation moves to `Relation#cache_key`, then
      we can avoid `send` to call internal methods.
      10919bfe
    • R
      Merge pull request #35847 from kamipo/optimizer_hints_with_count_subquery · d49761cd
      Ryuta Kamizono 提交于
      Optimizer hints should be applied on Top level query as much as possible
      d49761cd
    • R
      Merge pull request #35145 from st0012/fix-35114 · eda2d7d7
      Rafael França 提交于
      Fix partial caching ignore repeated items issue
      eda2d7d7
    • R
      Optimizer hints should be applied on Top level query as much as possible · 7fb2ba5e
      Ryuta Kamizono 提交于
      I've experienced this issue in our app, some hints only works on Top
      level query (e.g. `MAX_EXECUTION_TIME`).
      7fb2ba5e
    • S
      Fix partial caching ignore repeated items issue · e8688ddb
      st0012 提交于
      This is because we only use hash to maintain the result. So when the key
      are the same, the result would be skipped. The solution is to maintain
      an array for tracking every item's position to restructure the result.
      e8688ddb
    • R
      Remove redundant begin block · 464d6253
      Ryuta Kamizono 提交于
      We have `Style/RedundantBegin` cop (#34764) but it could not correct in
      this case.
      464d6253
    • R
      Don't drop internal metadata tables · 1f235a69
      Ryuta Kamizono 提交于
      Some tests expects that internal metadata tables exists, and we should
      not use `create_table` in transactional tests, since DDL in MySQL causes
      implicit commit.
      
      https://travis-ci.org/rails/rails/jobs/515438937#L3829
      1f235a69
    • R
      Merge pull request #30666 from urkle/fix-actionview-fixtureresolver · 4ecca4cd
      Rafael França 提交于
      Fix checking for template variants when using the ActionView::FixtureResolver
      4ecca4cd
    • E
      add documentation about variants · 90a8ce64
      Edward Rudd 提交于
      90a8ce64
    • E
    • R
      Ensure `reset_table_name` when table name prefix/suffix is changed · 2ca056be
      Ryuta Kamizono 提交于
      Also, `reset_column_information` is unnecessary since `reset_table_name`
      does that too.
      2ca056be
    • R
      Merge pull request #35842 from Shopify/deduplicate-routing-strings · 9d02b1bd
      Rafael França 提交于
      Deduplicate strings held by the router
      9d02b1bd
    • J
      Deduplicate strings held by the router · ed723486
      Jean Boussier 提交于
      ed723486
    • R
      Clear query cache when truncate table(s) · 8113c8e1
      Ryuta Kamizono 提交于
      8113c8e1
    • R
      Fix fragile tests · 8be22161
      Ryuta Kamizono 提交于
      8be22161
    • R
      fe0145c5
    • R
      Merge pull request #35844 from kamipo/fix_fixture_loading_performance_regression · 9bccf460
      Ryuta Kamizono 提交于
      Use `execute_batch2` rather than `execute_batch` to fix performance regression for fixture loading
      9bccf460
    • R
      Use `execute_batch2` rather than `execute_batch` to fix performance regression for fixture loading · 0908184e
      Ryuta Kamizono 提交于
      d8d6bd5e makes fixture loading to bulk statements by using
      `execute_batch` for sqlite3 adapter. But `execute_batch` is slower and
      it caused the performance regression for fixture loading.
      
      In sqlite3 1.4.0, it have new batch method `execute_batch2`. I've
      confirmed `execute_batch2` is extremely faster than `execute_batch`.
      So I think it is worth to upgrade sqlite3 to 1.4.0 to use that method.
      
      Before:
      
      ```
      % ARCONN=sqlite3 bundle exec ruby -w -Itest test/cases/associations/eager_test.rb -n test_eager_loading_too_may_ids
      Using sqlite3
      Run options: -n test_eager_loading_too_may_ids --seed 35790
      
      # Running:
      
      .
      
      Finished in 202.437406s, 0.0049 runs/s, 0.0049 assertions/s.
      1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
      ARCONN=sqlite3 bundle exec ruby -w -Itest  -n test_eager_loading_too_may_ids  142.57s user 60.83s system 98% cpu 3:27.08 total
      ```
      
      After:
      
      ```
      % ARCONN=sqlite3 bundle exec ruby -w -Itest test/cases/associations/eager_test.rb -n test_eager_loading_too_may_ids
      Using sqlite3
      Run options: -n test_eager_loading_too_may_ids --seed 16649
      
      # Running:
      
      .
      
      Finished in 8.471032s, 0.1180 runs/s, 0.1180 assertions/s.
      1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
      ARCONN=sqlite3 bundle exec ruby -w -Itest  -n test_eager_loading_too_may_ids  10.71s user 1.36s system 95% cpu 12.672 total
      ```
      0908184e
    • E
      Merge pull request #35825 from jhawthorn/always_filter_view_paths · d39b2b68
      Eileen M. Uchitelle 提交于
      Make Resolver#find_all_anywhere equivalent to #find_all
      d39b2b68
    • E
      Merge pull request #35843 from eregon/fix-gem-listen-in-gemfile-master · f960920a
      Eileen M. Uchitelle 提交于
      Add test that the listen gem is included when RUBY_ENGINE is not 'ruby'
      f960920a
    • T
      [skip ci] Add examples for has_{one,many} :through :source and :source_type (#35612) · af56c5c1
      Tim Wade 提交于
      * Add example for has_many :through source/source_type
      
      * Add example for has_one :through source/source_type
      af56c5c1
    • J
      Always reject files external to app · eb52904e
      John Hawthorn 提交于
      Previously, when using `render file:`, it was possible to render files
      not only at an absolute path or relative to the current directory, but
      relative to ANY view paths. This was probably done for absolutely
      maximum compatibility when addressing CVE-2016-0752, but I think is
      unlikely to be used in practice.
      
      Tihs commit removes the ability to `render file:` with a path relative
      to a non-fallback view path.
      
      Make FallbackResolver.new private
      
      To ensure nobody is making FallbackResolvers other than "/" and "".
      
      Make reject_files_external_... no-op for fallbacks
      
      Because there are only two values used for path: "" and "/", and
      File.join("", "") == File.join("/", "") == "/", this method was only
      testing that the absolute paths started at "/" (which of course all do).
      
      This commit doesn't change any behaviour, but it makes it explicit that
      the FallbackFileSystemResolver works this way.
      
      Remove outside_app_allowed argument
      
      Deprecate find_all_anywhere
      
      This is now equivalent to find_all
      
      Remove outside_app argument
      
      Deprecate find_file for find
      
      Both LookupContext#find_file and PathSet#find_file are now equivalent to
      their respective #find methods.
      eb52904e
  3. 03 4月, 2019 3 次提交