1. 16 8月, 2020 1 次提交
  2. 15 8月, 2020 9 次提交
  3. 14 8月, 2020 5 次提交
    • E
      Fix incorrect removal of current_shard in establish_connection · ba2f38e4
      eileencodes 提交于
      If we enter a `connected_to` block and call `establish_connection` like
      the test added here we need to ensure that `shard: current_shard` is passed
      to the handler, otherwise the connection will be established on
      `default` not on `shard_one`.
      Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
      ba2f38e4
    • E
      Merge pull request #40046 from composerinteralia/renaming-man · c93f3f02
      Eileen M. Uchitelle 提交于
      Rename test models for inclusivity
      c93f3f02
    • D
      Rename single letter variables · d79519f2
      Daniel Colson 提交于
      After renaming `Man` to `Human` the variable letter `m` in these tests
      ends up being pretty confusing. Rather than rename it to `h`, this
      commit replaces it with the full word `human`.
      
      Since I was already renaming things, I also went ahead and replaced `f`
      with `face`, `i` with `interest`, and `a` with `author`.
      d79519f2
    • D
      Replace test `Man` with `Human` · 7f938cac
      Daniel Colson 提交于
      The commit replaces the `Man` model used in tests with a `Human` model. It
      also replaces the existing `Human` model with a `SuperHuman` model
      inheriting from `Human`.
      
      While this may seem like a cosmetic change, I see it as more of an
      inclusivity change. I think it makes sense for a number of reasons:
      
      * Prior to this commit the `Human` model inherited from `Man`. At best
        this makes no sense (it should be the other way around). At worst it
        is offensive and harmful to the community.
      * It doesn't seem inclusive to me to have exclusively male-gendered
        examples in the codebase.
      * There is no particular reason for these examples to be gendered.
      * `man` is hard to grep for, since it also matches `many, manager,
        manual, etc`
      
      For the most part this is a simple search and replace. The one exception
      to that is that I had to add the table name to the model so we could use
      "humans" instead of "humen".
      7f938cac
    • R
      Fix incorrect result when eager loading with duplicated through association with join scope Part 2 · 62de28fb
      Ryuta Kamizono 提交于
      Follow up of #40000.
      
      In #40000, `eager_load(:general_categorizations, :general_posts)` works,
      but `eager_load(:general_posts, :general_categorizations)` doesn't work
      yet.
      
      This implements the deduplication for the case of reversed eager loading
      order.
      62de28fb
  4. 13 8月, 2020 3 次提交
  5. 12 8月, 2020 9 次提交
    • J
      Merge pull request #39971 from jonathanhefner/docs-baseline-defaults · f4471fc7
      Jonathan Hefner 提交于
      Add baseline defaults section [ci skip]
      f4471fc7
    • J
      Merge pull request #39950 from sohymg/patch-1 · e6026143
      Jonathan Hefner 提交于
      [ci skip] Add clarity on protect_from_forgery documentation
      e6026143
    • R
      Merge pull request #40027 from yahonda/diag_38697_2 · 0672be9b
      Ryuta Kamizono 提交于
      Address `ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true`
      0672be9b
    • Y
      Address `ArgumentError: Missing host to link to! Please provide the :host... · 2d43d477
      Yasuo Honda 提交于
      Address `ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true`
      
      This pull request fixes #38697
      
      It is caused by `@controller.singleton_class.include @routes.url_helpers` when `@controller` is nil in `ActionController::TestCase`.
      
      * Without this commit
      
      ```ruby
      % cd actionview
      % PARALLEL_WORKERS=1 bin/test test/actionpack/controller/layout_test.rb test/template/url_helper_test.rb --seed 16702 -n "/^(?:LayoutSetInResponseTest#(?:test_layout_symbol_set_in_controller_returning_nil_falls_back_to_default)|UrlHelperTest#(?:test_url_for_with_array_and_only_path_set_to_false))$/"
      
      Run options: --seed 16702 -n "/^(?:LayoutSetInResponseTest#(?:test_layout_symbol_set_in_controller_returning_nil_falls_back_to_default)|UrlHelperTest#(?:test_url_for_with_array_and_only_path_set_to_false))$/"
      
      .E
      
      Error:
      UrlHelperTest#test_url_for_with_array_and_only_path_set_to_false:
      ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/http/url.rb:64:in `full_url_for'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/http/url.rb:54:in `url_for'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:333:in `block in <class:RouteSet>'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:838:in `url_for'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:270:in `call'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:213:in `call'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:326:in `block in define_url_helper'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb:233:in `polymorphic_method'
          /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb:116:in `polymorphic_url'
          /Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/routing_url_for.rb:104:in `url_for'
          /Users/yahonda/src/github.com/rails/rails/actionview/test/template/url_helper_test.rb:102:in `test_url_for_with_array_and_only_path_set_to_false'
      
      bin/test test/template/url_helper_test.rb:100
      
      Finished in 0.042275s, 47.3093 runs/s, 47.3093 assertions/s.
      2 runs, 2 assertions, 0 failures, 1 errors, 0 skips
      %
      ```
      2d43d477
    • Y
      Updated security.md to include default_protect_from_forgery · 28c5eca9
      Yu Ming 提交于
      Update security.md to note that CSRF security token is included in requests automatically when `config.action_controller.default_protect_from_forgery` is set to `true`, which is the default for newly created Rails applications.
      28c5eca9
    • R
      Merge pull request #40025 from KapilSachdev/fix/uninitialized_instance_variable · e4b5ced3
      Ryuta Kamizono 提交于
      fix: warning: instance variable @controller not initialized
      Co-authored-by: NSamuel Williams <samuel.williams@oriontransfer.co.nz>
      e4b5ced3
    • J
      Identify directly-uploaded blobs before saving the associated record · 6aa26c30
      Jonathan Hefner 提交于
      An Active Storage `Blob` must be identified before it can be reliably
      validated.  For direct uploads, a `Blob` is identified when it is
      attached, rather than when it is created.
      
      Before this commit, the sequence of events when attaching a `Blob` was:
      
      1. Find the `Blob`.
      2. Assign the `Blob` to an `Attachment`.
      3. Save the owner record.
      4. Save the `Attachment`.
      5. Identify the `Blob`'s true `content_type` from its file.
      6. Save the `Blob`.
      
      This meant that the owner record's validations might not see the
      `Blob`'s true `content_type`.
      
      After this commit, the sequence of events will be:
      
      1. Find the `Blob`.
      2. Identify the `Blob`'s true `content_type` from its file.
      3. Assign the `Blob` to an `Attachment`.
      4. Save the owner record.
      5. Save the `Attachment`.
      6. Save the `Blob`.
      
      Thus the `Blob`'s true `content_type` will be available when running the
      owner record's validations.
      6aa26c30
    • J
      Merge pull request #40024 from abhaynikam/document-multidb-dbconsole-command · b32a614d
      Jonathan Hefner 提交于
      Document dbconsole command for multiple database [ci skip]
      b32a614d
    • A
  6. 11 8月, 2020 5 次提交
  7. 10 8月, 2020 4 次提交
  8. 08 8月, 2020 4 次提交
    • C
      3c500511
    • E
      Merge pull request #40003 from eileencodes/remove-unnecessary-with_temporary_connection_pool-calls · 5d3b9f7c
      Eileen M. Uchitelle 提交于
      Remove unnecessary with_temporary_connection_pool calls
      5d3b9f7c
    • E
      Update connection methods to use kwargs · d3061cda
      eileencodes 提交于
      This change ensures that the connection methods are using kwargs instead
      of positional arguments. This change may look unnecessary but we're
      working on refactoring connection management to make it more robust and
      flexible so the method signatures of the methods changed here will
      continue to evolve and change.
      
      This commit does not change any released public APIs. The `shard` and
      `owner_name` arguments were added in 6.1 which is not released yet.
      Using kwargs will allow these methods to be more flexible and not get
      super ugly as we change their underlying behavior. The kwargs let us
      support multiple non-positional arguments with default.
      Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
      d3061cda
    • E
      Rename `pool_key` to `shard` · 85ef2196
      eileencodes 提交于
      This change renames the following:
      
      * `current_pool_key` -> `current_shard`
      * `default_pool_key` -> `default_shard`
      * `pool_key` -> `shard`
      
      Originally we had intended to name the `shard` as `pool_key` because
      when we implemented the internal private API we weren't sure how it was
      going to be used for sharding and wanted to implement behavior without
      promising a public API. Now that we have a public API for sharding it's
      better to use the same name everywhere rather than have one name for
      private APIs and one name for public APIs. This should make
      contributions and tracking down bugs easier in the future.
      
      This PR doesn't require any deprecations because the sharding API is
      unreleased and so is all the internal code that was using `pool_key`.
      Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
      85ef2196