1. 23 8月, 2020 4 次提交
  2. 21 8月, 2020 5 次提交
  3. 20 8月, 2020 5 次提交
  4. 19 8月, 2020 7 次提交
  5. 18 8月, 2020 7 次提交
  6. 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
  7. 16 8月, 2020 3 次提交
  8. 15 8月, 2020 3 次提交
    • P
      Use superclass name in inspect of ActionView::Base.with_empty_template_cache · a7ed92bd
      Petrik 提交于
      When rendering views an anonymous subclass is created by calling
      ActionView::Base.with_empty_template_cache.
      This causes inspect to return an unhelpful description when calling
      inspect:
      `#<#<Class:0x012345012345>:<0x012345012345>`.
      
      This can be confusing when exceptions are raised because it's hard to
      figure out where to look. For example calling an undefined method in a
      template would raise the following exception:
      
          undefined method `undefined' for #<#<Class:0x012345012345>:<0x012345012345>
      
      Instead we can return the non-anonymous superclass name.
      
          undefined method `undefined' for #<ActionView::Base:0x01234502345>
      
      The anonymous class is created in ActionView::Base.with_empty_template_cache.
      See f9bea630
      This seems to be done for performance reasons only, without expecting a
      change to calling `inspect`.
      a7ed92bd
    • J
      Merge pull request #39905 from mehagar/testing_docs · 8a578c46
      Jonathan Hefner 提交于
      Remove double negative in testing docs [ci-skip]
      8a578c46
    • M
      epsilon invert · a3e1590e
      Michael Hagar 提交于
      Update guides/source/testing.md
      Co-authored-by: NJonathan Hefner <jonathan@hefner.pro>
      a3e1590e