1. 19 8月, 2020 4 次提交
  2. 18 8月, 2020 7 次提交
  3. 17 8月, 2020 6 次提交
    • E
    • E
      Merge pull request #39886 from... · 6508a5f2
      Eileen M. Uchitelle 提交于
      Merge pull request #39886 from lanzhiheng/append-some-description-about-advance-constraints-in-block-form
      
       [ci skip] Append some description about advance constraints
      6508a5f2
    • E
      Merge pull request #39939 from Shopify/link-preload-headers · 443c8470
      Eileen M. Uchitelle 提交于
      Automatically set Link header for each stylesheet and script
      443c8470
    • R
      Merge pull request #39999 from kamipo/fix_eager_loading_with_explicit_non_select · 9078abc0
      Ryuta Kamizono 提交于
      Fix eager loading that non-select columns will be loaded
      9078abc0
    • R
      Merge pull request #40056 from kamipo/fix_preloader_associate_by_default · 4aa6559b
      Ryuta Kamizono 提交于
      Fix preloader to associate preloaded records by default
      4aa6559b
    • R
      Fix eager loading that non-select columns will be loaded · 46393182
      Ryuta Kamizono 提交于
      Related to #35210.
      
      We sometimes use `select` to limit unused columns for performance.
      
      For example, `GET /posts/1` (post detail) usually use (almost) all
      columns, but `GET /posts` (post list) does not always use all columns
      (e.g. use `id` and `title` for the list view, but `body` is not used).
      
      If an association is eager loaded, the limited `select` doesn't works as
      expected, eager loading will load all columns on the model, plus also
      load the `select` columns additionally. It works differently with
      natural load and preload. It means that changing natural load or preload
      to eager load (or vice versa) is unsafe.
      
      This fixes eager loading that always load all columns (plus extra
      `select` columns), to respect the `select` columns like as others.
      
      ```ruby
      post = Post.select("UPPER(title) AS title").first
      post.title # => "WELCOME TO THE WEBLOG"
      post.body  # => ActiveModel::MissingAttributeError
      
      # Rails 6.0 (ignore the `select` values)
      post = Post.select("UPPER(title) AS title").eager_load(:comments).first
      post.title # => "Welcome to the weblog"
      post.body  # => "Such a lovely day"
      
      # Rails 6.1 (respect the `select` values)
      post = Post.select("UPPER(title) AS title").eager_load(:comments).first
      post.title # => "WELCOME TO THE WEBLOG"
      post.body  # => ActiveModel::MissingAttributeError
      ```
      46393182
  4. 16 8月, 2020 3 次提交
  5. 15 8月, 2020 10 次提交
  6. 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
  7. 13 8月, 2020 4 次提交
  8. 12 8月, 2020 1 次提交