1. 16 3月, 2019 1 次提交
    • S
      Rename `ActionView::Base#run` to `#_run` · 47fea39e
      Seb Jacobs 提交于
      There was a recent change by @tenderlove to Action view which introduced
      `ActionView::Base#run` [1].
      
      We ran into an issue with our application because one of the core
      concepts in our domain model is a `Run` which is exposed in most of our
      views as a helper method, which now conflicts with this new method.
      
      Although this is a public method it is not really meant to be part of
      the public API.
      
      In order to discourage public use of this method and to reduce the
      chances of this method conflicting with helper methods we can prefix
      this method with an underscore, renaming this method to `_run`.
      
      [1] https://github.com/rails/rails/commit/c740ebdaf5
      47fea39e
  2. 16 2月, 2019 1 次提交
    • A
      Pass the template format to the digestor · 1581cab9
      Aaron Patterson 提交于
      This commit passes the template format to the digestor in order to come
      up with a key.  Before this commit, the digestor would depend on the
      side effect of the template renderer setting the rendered_format on the
      lookup context.  I would like to remove that mutation, so I've changed
      this to pass the template format in to the digestor.
      
      I've introduced a new instance variable that will be alive during a
      template render.  When the template is being rendered, it pushes the
      current template on to a stack, setting `@current_template` to the
      template currently being rendered.  When the cache helper asks the
      digestor for a key, it uses the format of the template currently on the
      stack.
      1581cab9
  3. 12 2月, 2019 1 次提交
    • A
      Turn lookup context in to a stack, push and pop if formats change · 2b6d2d20
      Aaron Patterson 提交于
      This commit keeps a stack of lookup contexts on the ActionView::Base
      instance.  If a format is passed to render, we instantiate a new lookup
      context and push it on the stack, that way any child calls to "render"
      will use the same format information as the parent.  This also isolates
      "sibling" calls to render (multiple calls to render in the same
      template).
      
      Fixes #35222 #34138
      2b6d2d20
  4. 30 1月, 2019 1 次提交
  5. 17 1月, 2019 3 次提交
  6. 24 7月, 2017 1 次提交
  7. 02 7月, 2017 1 次提交
  8. 01 7月, 2017 1 次提交
  9. 25 1月, 2017 1 次提交
    • J
      Change ActionView ERB Handler from Erubis to Erubi · 7da8d762
      Jeremy Evans 提交于
      Erubi offers the following advantages for Rails:
      
      * Works with ruby's --enable-frozen-string-literal option
      * Has 88% smaller memory footprint
      * Does no freedom patching (Erubis adds a method to Kernel)
      * Has simpler internals (1 file, <150 lines of code)
      * Has an open development model (Erubis doesn't have a
        public source control repository or bug tracker)
      * Is not dead (Erubis hasn't been updated since 2011)
      
      Erubi is a simplified fork of Erubis that contains just the
      parts that are generally needed (which includes the parts
      that Rails uses).  The only intentional difference in
      behavior is that it does not include support for <%=== tags
      for debug output.  That could be added to the ActionView ERB
      handler if it is desired.
      
      The Erubis template handler remains in a deprecated state
      so that code that accesses it directly does not break.  It
      can be removed after Rails 5.1.
      7da8d762