Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where with block #1

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open

Where with block #1

wants to merge 36 commits into from

Commits on May 20, 2020

  1. Only use valid handlers in resolver_shared_tests

    We don't have jbuilder installed (this would work if it was).
    jhawthorn committed May 20, 2020
    Configuration menu
    Copy the full SHA
    dc778f8 View commit details
    Browse the repository at this point in the history
  2. Add tests of resolver variant handling

    The template resolver is supposed to determine the handler, format, and
    variant from the path in extract_handler_and_format_and_variant.
    
    This commit adds tests for how variants are parsed from the filenames
    found in the resolver. It includes two skipped tests which currently fail.
    jhawthorn committed May 20, 2020
    Configuration menu
    Copy the full SHA
    8762d93 View commit details
    Browse the repository at this point in the history
  3. Introduce Resolver::PathParser

    The template resolver is supposed to determine the handler, format, and
    variant from the path in extract_handler_and_format_and_variant.
    
    Previously this behaviour was close but didn't exactly match the
    behaviour of finding templates, and in some cases (particularly with
    handlers or formats missing) would return incorrect results.
    
    This commit introduces Resolver::PathParser, a class which should be
    able to accurately from any path inside a view directory be able to tell
    us exactly the prefix, partial, variant, locale, format, variant, and
    handler of that template.
    
    This works by building a building a regexp from the known handlers and
    file types. This requires that any resolvers have their cache cleared
    when new handlers or types are registered (this was already somewhat the
    requirement, since resolver lookups are cached, but this makes it
    necessary in more situations).
    jhawthorn committed May 20, 2020
    Configuration menu
    Copy the full SHA
    e53c45b View commit details
    Browse the repository at this point in the history
  4. Mark PathParser as :nodoc:

    jhawthorn committed May 20, 2020
    Configuration menu
    Copy the full SHA
    827119c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f02ab3e View commit details
    Browse the repository at this point in the history

Commits on May 22, 2020

  1. Clear cache after setting Template::Types delegate

    details_cache_key already references Template::Types.symbols and view
    resolvers cache based on default_formats and other values. This
    previously wasn't an issue because no views had been looked up before
    this was set. Now that we are building a regex from the values of
    Template::Types.symbols we need to clear cache after changing this
    setting.
    jhawthorn committed May 22, 2020
    Configuration menu
    Copy the full SHA
    096d143 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2020

  1. Remove unused limit on enum and set columns in MySQL

    Before rails#36604, `enum` and `set` columns were incorrectly dumped as a
    `string` column.
    
    If an `enum` column is defined as `foo enum('apple','orange')`, it was
    dumped as `t.string :foo, limit: 6`, the `limit: 6` is seemed to
    restrict invalid string longer than `'orange'`.
    
    But now, `enum` and `set` columns are correctly dumped as `enum` and
    `set` columns, the limit as longest element is no longer used.
    kamipo committed May 24, 2020
    Configuration menu
    Copy the full SHA
    86a9b36 View commit details
    Browse the repository at this point in the history
  2. merge(..., rewhere: true) should have the ability to overwrite non-…

    …attribute nodes
    
    Related to rails#7380 and rails#7392.
    
    `merge` allows to overwrite non-attribute nodes by rails#7392, so
    `merge(..., rewhere: true)` should also have the same ability, to
    migrate from the half-baked current behavior to entirely consistent new
    behavior.
    kamipo committed May 24, 2020
    Configuration menu
    Copy the full SHA
    e5953db View commit details
    Browse the repository at this point in the history

Commits on May 25, 2020

  1. Merge pull request rails#39408 from kamipo/remove_limit_on_enum

    Remove unused `limit` on `enum` and `set` columns in MySQL
    kamipo authored May 25, 2020
    Configuration menu
    Copy the full SHA
    8e7080e View commit details
    Browse the repository at this point in the history
  2. Merge pull request rails#39415 from kamipo/merge_rewhere_with_non_attrs

    `merge(..., rewhere: true)` should have the ability to overwrite non-attribute nodes
    kamipo authored May 25, 2020
    Configuration menu
    Copy the full SHA
    0571da9 View commit details
    Browse the repository at this point in the history
  3. Fix typo

    swaggermeister authored May 25, 2020
    Configuration menu
    Copy the full SHA
    2a1ec6e View commit details
    Browse the repository at this point in the history
  4. Fix preloading for polymorphic association with custom scope

    rails#39378 has changed to use `build_scope` in `join_scopes`, which rely on
    `reflection.klass`, but `reflection.klass` is restricted for polymorphic
    association, the klass for the association should be passed explicitly.
    kamipo committed May 25, 2020
    Configuration menu
    Copy the full SHA
    4f95ff7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f7d21e4 View commit details
    Browse the repository at this point in the history
  6. Merge pull request rails#39424 from kamipo/fix_preload_for_polymorphi…

    …c_association
    
    Fix preloading for polymorphic association with custom scope
    kamipo authored May 25, 2020
    Configuration menu
    Copy the full SHA
    803c030 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2020

  1. Fix Active Storage behavior on record dup

    Prior to this commit, a `dup`ed record and its originating record would
    share the same `Attached` proxy objects.  Those proxy objects, in turn,
    would point to the same `Attachment` associations, causing changes made
    through the proxy interface to affect both records.
    jonathanhefner authored May 26, 2020
    Configuration menu
    Copy the full SHA
    d02d259 View commit details
    Browse the repository at this point in the history
  2. Merge pull request rails#39417 from roramirez/early-hints-no-content

    Add status the 103 Early Hints as Not content for action_dispatch
    eugeneius authored May 26, 2020
    Configuration menu
    Copy the full SHA
    a47e0c1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2db687f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3582de9 View commit details
    Browse the repository at this point in the history
  5. Merge pull request rails#39437 from vinistock/remove_dup_from_set_con…

    …tent_type
    
    Remove dup from Request#set_cotent_type
    kamipo authored May 26, 2020
    Configuration menu
    Copy the full SHA
    8153954 View commit details
    Browse the repository at this point in the history
  6. Remove dup from post body for forcing encoding (rails#39438)

    * Remove dup from post body for forcing encoding
    
    * Properly assign raw_post variable to encoded version
    
    Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
    vinistock and kamipo authored May 26, 2020
    Configuration menu
    Copy the full SHA
    64b17ba View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c4682ea View commit details
    Browse the repository at this point in the history
  8. Prefer string interpolation over direct mutation

    It is safer than direct mutation.
    kamipo committed May 26, 2020
    Configuration menu
    Copy the full SHA
    7c93699 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    da21ac7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8071ba7 View commit details
    Browse the repository at this point in the history
  11. Merge pull request rails#39442 from fatkodima/actionpack-docs-fixes

    A few action_controller docs corrections [skip ci]
    vipulnsward authored May 26, 2020
    Configuration menu
    Copy the full SHA
    a970efb View commit details
    Browse the repository at this point in the history
  12. Merge pull request rails#39441 from fatkodima/caching-delete-autoload

    No need to extend ActionController::Caching by ActiveSupport::Autoload
    kamipo authored May 26, 2020
    Configuration menu
    Copy the full SHA
    b91906c View commit details
    Browse the repository at this point in the history
  13. Ensure cache fragment digests include all templates

    A Rails view may rely on several templates (e.g. layouts and partials)
    in addition to the template for the action being rendered (e.g.
    "show.html.erb"). To track which view file is currently being rendered
    for the purpose of generating template tree digests used in cache
    fragment keys, Action View uses a stack, the top item of which is
    accessed via the @current_template variable (introduced in 1581cab).
    
    Consider the following template:
    
        <!-- home.html.erb -->
        <%= render layout: "wrapper" do %>
          <%= cache "foo" %>
            HOME
          <%= end %>
        <%= end %>
    
    Inside the block passed to the render helper, @current_template
    corresponds to the wrapper.html.erb template instead of home.html.erb.
    As wrapper.html.erb is then used as the root node for generating the
    template tree digest used in the cache fragment key, the cache fragment
    fails to expire upon changes to home.html.erb. Additionally, should a
    second template use the wrapper.html.erb layout and contain a cache
    fragment with the same key, the cache fragment keys for both templates
    will be identical - causing cached content to "leak" from one view to
    another (as described in rails#38984).
    
    This commit skips adding templates to the stack when rendered as a
    layout with a block via the render helper, ensuring correct and unique
    cache fragment digests. Additionally, the virtual_path keyword arguments
    found in CacheHelper and all references to the are removed as they no
    longer possess any function. (Following the introduction of
    @current_template, virtual_path is accessed via
    @current_template.virtual_path rather than as a standalone variable.)
    alipman88 committed May 26, 2020
    Configuration menu
    Copy the full SHA
    4671fe2 View commit details
    Browse the repository at this point in the history
  14. Remove redundant @virtual_path variable

    Following the introduction of the @current_template variable in 1581cab,
    the @virtual_path variable is now redundant, as the value of the virtual
    path may be accessed via @current_template.virtual_path. This commit
    removes @virtual_path and replaces any references to @virtual_path with
    @current_template.virtual_path.
    alipman88 committed May 26, 2020
    Configuration menu
    Copy the full SHA
    dd7a673 View commit details
    Browse the repository at this point in the history
  15. Merge pull request rails#39060 from alipman88/fix_cache_fragment_digests

    Ensure cache fragment keys (i.e. dependency tree digests) include all relevant templates
    tenderlove authored May 26, 2020
    Configuration menu
    Copy the full SHA
    b378bda View commit details
    Browse the repository at this point in the history
  16. Fix flaky assert queries tests

    `assert_no_queries` sometimes fails due to counting implict schema info
    load queries, most case that is enough to just ignore it.
    
    https://buildkite.com/rails/rails/builds/69598#321bb1bc-ec67-40cd-813f-68dc7809ddde/1444-1452
    kamipo committed May 26, 2020
    Configuration menu
    Copy the full SHA
    95e1305 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2020

  1. rewhere allow to overwrite non-attribute nodes

    Follow up to rails#39415.
    kamipo committed May 27, 2020
    Configuration menu
    Copy the full SHA
    787b991 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a70ad60 View commit details
    Browse the repository at this point in the history
  3. Merge pull request rails#39361 from jhawthorn/path_parser

    Introduce Resolver::PathParser
    jhawthorn authored May 27, 2020
    Configuration menu
    Copy the full SHA
    db543ba View commit details
    Browse the repository at this point in the history
  4. Allow calling where with a block

    Bruno Vezoli committed May 27, 2020
    Configuration menu
    Copy the full SHA
    aaf1473 View commit details
    Browse the repository at this point in the history
  5. Allow getting attributes through method calls on composer

    Bruno Vezoli committed May 27, 2020
    Configuration menu
    Copy the full SHA
    bf0f502 View commit details
    Browse the repository at this point in the history
  6. Allow calling methods as instance methods on blocks

    Bruno Vezoli committed May 27, 2020
    Configuration menu
    Copy the full SHA
    189b077 View commit details
    Browse the repository at this point in the history