actionview 5.1.7 → 5.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionview might be problematic. Click here for more details.

Files changed (107) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +27 -275
  3. data/README.rdoc +1 -1
  4. data/lib/action_view.rb +3 -2
  5. data/lib/action_view/base.rb +8 -10
  6. data/lib/action_view/buffers.rb +2 -0
  7. data/lib/action_view/context.rb +2 -2
  8. data/lib/action_view/dependency_tracker.rb +2 -0
  9. data/lib/action_view/digestor.rb +6 -12
  10. data/lib/action_view/flows.rb +2 -0
  11. data/lib/action_view/gem_version.rb +5 -3
  12. data/lib/action_view/helpers.rb +2 -0
  13. data/lib/action_view/helpers/active_model_helper.rb +9 -3
  14. data/lib/action_view/helpers/asset_tag_helper.rb +79 -22
  15. data/lib/action_view/helpers/asset_url_helper.rb +13 -11
  16. data/lib/action_view/helpers/atom_feed_helper.rb +3 -1
  17. data/lib/action_view/helpers/cache_helper.rb +24 -14
  18. data/lib/action_view/helpers/capture_helper.rb +9 -7
  19. data/lib/action_view/helpers/controller_helper.rb +3 -1
  20. data/lib/action_view/helpers/csrf_helper.rb +4 -2
  21. data/lib/action_view/helpers/date_helper.rb +5 -3
  22. data/lib/action_view/helpers/debug_helper.rb +3 -1
  23. data/lib/action_view/helpers/form_helper.rb +43 -60
  24. data/lib/action_view/helpers/form_options_helper.rb +9 -7
  25. data/lib/action_view/helpers/form_tag_helper.rb +20 -11
  26. data/lib/action_view/helpers/javascript_helper.rb +5 -3
  27. data/lib/action_view/helpers/number_helper.rb +2 -0
  28. data/lib/action_view/helpers/output_safety_helper.rb +2 -0
  29. data/lib/action_view/helpers/record_tag_helper.rb +3 -1
  30. data/lib/action_view/helpers/rendering_helper.rb +4 -1
  31. data/lib/action_view/helpers/sanitize_helper.rb +3 -1
  32. data/lib/action_view/helpers/tag_helper.rb +2 -2
  33. data/lib/action_view/helpers/tags.rb +3 -1
  34. data/lib/action_view/helpers/tags/base.rb +12 -10
  35. data/lib/action_view/helpers/tags/check_box.rb +3 -1
  36. data/lib/action_view/helpers/tags/checkable.rb +4 -2
  37. data/lib/action_view/helpers/tags/collection_check_boxes.rb +2 -0
  38. data/lib/action_view/helpers/tags/collection_helpers.rb +2 -0
  39. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +2 -0
  40. data/lib/action_view/helpers/tags/collection_select.rb +3 -1
  41. data/lib/action_view/helpers/tags/color_field.rb +3 -1
  42. data/lib/action_view/helpers/tags/date_field.rb +2 -0
  43. data/lib/action_view/helpers/tags/date_select.rb +3 -1
  44. data/lib/action_view/helpers/tags/datetime_field.rb +3 -1
  45. data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -0
  46. data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
  47. data/lib/action_view/helpers/tags/email_field.rb +2 -0
  48. data/lib/action_view/helpers/tags/file_field.rb +2 -0
  49. data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -1
  50. data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
  51. data/lib/action_view/helpers/tags/label.rb +2 -4
  52. data/lib/action_view/helpers/tags/month_field.rb +2 -0
  53. data/lib/action_view/helpers/tags/number_field.rb +2 -0
  54. data/lib/action_view/helpers/tags/password_field.rb +2 -0
  55. data/lib/action_view/helpers/tags/placeholderable.rb +2 -0
  56. data/lib/action_view/helpers/tags/radio_button.rb +3 -1
  57. data/lib/action_view/helpers/tags/range_field.rb +2 -0
  58. data/lib/action_view/helpers/tags/search_field.rb +2 -0
  59. data/lib/action_view/helpers/tags/select.rb +5 -3
  60. data/lib/action_view/helpers/tags/tel_field.rb +2 -0
  61. data/lib/action_view/helpers/tags/text_area.rb +3 -1
  62. data/lib/action_view/helpers/tags/text_field.rb +3 -1
  63. data/lib/action_view/helpers/tags/time_field.rb +2 -0
  64. data/lib/action_view/helpers/tags/time_select.rb +2 -0
  65. data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
  66. data/lib/action_view/helpers/tags/translator.rb +2 -0
  67. data/lib/action_view/helpers/tags/url_field.rb +2 -0
  68. data/lib/action_view/helpers/tags/week_field.rb +2 -0
  69. data/lib/action_view/helpers/text_helper.rb +4 -2
  70. data/lib/action_view/helpers/translation_helper.rb +5 -4
  71. data/lib/action_view/helpers/url_helper.rb +24 -5
  72. data/lib/action_view/layouts.rb +7 -5
  73. data/lib/action_view/log_subscriber.rb +5 -3
  74. data/lib/action_view/lookup_context.rb +4 -4
  75. data/lib/action_view/model_naming.rb +2 -0
  76. data/lib/action_view/path_set.rb +2 -0
  77. data/lib/action_view/railtie.rb +11 -2
  78. data/lib/action_view/record_identifier.rb +2 -0
  79. data/lib/action_view/renderer/abstract_renderer.rb +2 -0
  80. data/lib/action_view/renderer/partial_renderer.rb +13 -11
  81. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +4 -2
  82. data/lib/action_view/renderer/renderer.rb +2 -0
  83. data/lib/action_view/renderer/streaming_template_renderer.rb +3 -1
  84. data/lib/action_view/renderer/template_renderer.rb +2 -0
  85. data/lib/action_view/rendering.rb +3 -5
  86. data/lib/action_view/routing_url_for.rb +2 -0
  87. data/lib/action_view/tasks/cache_digests.rake +2 -0
  88. data/lib/action_view/template.rb +6 -4
  89. data/lib/action_view/template/error.rb +2 -3
  90. data/lib/action_view/template/handlers.rb +3 -1
  91. data/lib/action_view/template/handlers/builder.rb +3 -4
  92. data/lib/action_view/template/handlers/erb.rb +5 -9
  93. data/lib/action_view/template/handlers/erb/erubi.rb +2 -0
  94. data/lib/action_view/template/handlers/html.rb +2 -0
  95. data/lib/action_view/template/handlers/raw.rb +2 -0
  96. data/lib/action_view/template/html.rb +3 -1
  97. data/lib/action_view/template/resolver.rb +7 -6
  98. data/lib/action_view/template/text.rb +3 -1
  99. data/lib/action_view/template/types.rb +3 -1
  100. data/lib/action_view/test_case.rb +21 -5
  101. data/lib/action_view/testing/resolvers.rb +3 -1
  102. data/lib/action_view/version.rb +2 -0
  103. data/lib/action_view/view_paths.rb +3 -3
  104. data/lib/assets/compiled/rails-ujs.js +3 -3
  105. metadata +14 -15
  106. data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +0 -9
  107. data/lib/action_view/template/handlers/erb/erubis.rb +0 -81
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_view/helpers/tags/placeholderable"
2
4
 
3
5
  module ActionView
@@ -14,7 +16,7 @@ module ActionView
14
16
  options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
15
17
  end
16
18
 
17
- content_tag("textarea", options.delete("value") { value_before_type_cast(object) }, options)
19
+ content_tag("textarea", options.delete("value") { value_before_type_cast }, options)
18
20
  end
19
21
  end
20
22
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_view/helpers/tags/placeholderable"
2
4
 
3
5
  module ActionView
@@ -10,7 +12,7 @@ module ActionView
10
12
  options = @options.stringify_keys
11
13
  options["size"] = options["maxlength"] unless options.key?("size")
12
14
  options["type"] ||= field_type
13
- options["value"] = options.fetch("value") { value_before_type_cast(object) } unless field_type == "file"
15
+ options["value"] = options.fetch("value") { value_before_type_cast } unless field_type == "file"
14
16
  add_default_name_and_id(options)
15
17
  tag("input", options)
16
18
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -11,7 +13,7 @@ module ActionView
11
13
 
12
14
  def render
13
15
  select_content_tag(
14
- time_zone_options_for_select(value(@object) || @options[:default], @priority_zones, @options[:model] || ActiveSupport::TimeZone), @options, @html_options
16
+ time_zone_options_for_select(value || @options[:default], @priority_zones, @options[:model] || ActiveSupport::TimeZone), @options, @html_options
15
17
  )
16
18
  end
17
19
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module Helpers
3
5
  module Tags # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/core_ext/string/filters"
2
4
  require "active_support/core_ext/array/extract_options"
3
5
 
@@ -420,7 +422,7 @@ module ActionView
420
422
  def to_s
421
423
  value = @values[@index].to_s
422
424
  @index = next_index
423
- return value
425
+ value
424
426
  end
425
427
 
426
428
  private
@@ -444,7 +446,7 @@ module ActionView
444
446
  # uses an instance variable of ActionView::Base.
445
447
  def get_cycle(name)
446
448
  @_cycles = Hash.new unless defined?(@_cycles)
447
- return @_cycles[name]
449
+ @_cycles[name]
448
450
  end
449
451
 
450
452
  def set_cycle(name, cycle_object)
@@ -1,18 +1,19 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_view/helpers/tag_helper"
2
4
  require "active_support/core_ext/string/access"
3
5
  require "i18n/exceptions"
4
6
 
5
7
  module ActionView
6
8
  # = Action View Translation Helpers
7
- module Helpers
9
+ module Helpers #:nodoc:
8
10
  module TranslationHelper
9
11
  extend ActiveSupport::Concern
10
12
 
11
13
  include TagHelper
12
14
 
13
15
  included do
14
- mattr_accessor :debug_missing_translation
15
- self.debug_missing_translation = true
16
+ mattr_accessor :debug_missing_translation, default: true
16
17
  end
17
18
 
18
19
  # Delegates to <tt>I18n#translate</tt> but also performs three additional
@@ -96,7 +97,7 @@ module ActionView
96
97
  raise e if raise_error
97
98
 
98
99
  keys = I18n.normalize_keys(e.locale, e.key, e.options[:scope])
99
- title = "translation missing: #{keys.join('.')}"
100
+ title = "translation missing: #{keys.join('.')}".dup
100
101
 
101
102
  interpolations = options.except(:default, :scope)
102
103
  if interpolations.any?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_view/helpers/javascript_helper"
2
4
  require "active_support/core_ext/array/access"
3
5
  require "active_support/core_ext/hash/keys"
@@ -587,10 +589,27 @@ module ActionView
587
589
  end
588
590
 
589
591
  def add_method_to_attributes!(html_options, method)
590
- if method && method.to_s.downcase != "get".freeze && html_options["rel".freeze] !~ /nofollow/
591
- html_options["rel".freeze] = "#{html_options["rel".freeze]} nofollow".lstrip
592
+ if method_not_get_method?(method) && html_options["rel"] !~ /nofollow/
593
+ if html_options["rel"].blank?
594
+ html_options["rel"] = "nofollow"
595
+ else
596
+ html_options["rel"] = "#{html_options["rel"]} nofollow"
597
+ end
592
598
  end
593
- html_options["data-method".freeze] = method
599
+ html_options["data-method"] = method
600
+ end
601
+
602
+ STRINGIFIED_COMMON_METHODS = {
603
+ get: "get",
604
+ delete: "delete",
605
+ patch: "patch",
606
+ post: "post",
607
+ put: "put",
608
+ }.freeze
609
+
610
+ def method_not_get_method?(method)
611
+ return false unless method
612
+ (STRINGIFIED_COMMON_METHODS[method] || method.to_s.downcase) != "get"
594
613
  end
595
614
 
596
615
  def token_tag(token = nil, form_options: {})
@@ -610,7 +629,7 @@ module ActionView
610
629
  # suitable for use as the names and values of form input fields:
611
630
  #
612
631
  # to_form_params(name: 'David', nationality: 'Danish')
613
- # # => [{name: 'name', value: 'David'}, {name: 'nationality', value: 'Danish'}]
632
+ # # => [{name: :name, value: 'David'}, {name: 'nationality', value: 'Danish'}]
614
633
  #
615
634
  # to_form_params(country: {name: 'Denmark'})
616
635
  # # => [{name: 'country[name]', value: 'Denmark'}]
@@ -642,7 +661,7 @@ module ActionView
642
661
  params.push(*to_form_params(value, array_prefix))
643
662
  end
644
663
  else
645
- params << { name: namespace.to_s, value: attribute.to_param }
664
+ params << { name: namespace, value: attribute.to_param }
646
665
  end
647
666
 
648
667
  params.sort_by { |pair| pair[:name] }
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_view/rendering"
2
- require "active_support/core_ext/module/remove_method"
4
+ require "active_support/core_ext/module/redefine_method"
3
5
 
4
6
  module ActionView
5
7
  # Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in
@@ -204,9 +206,9 @@ module ActionView
204
206
  include ActionView::Rendering
205
207
 
206
208
  included do
207
- class_attribute :_layout, :_layout_conditions, instance_accessor: false
208
- self._layout = nil
209
- self._layout_conditions = {}
209
+ class_attribute :_layout, instance_accessor: false
210
+ class_attribute :_layout_conditions, instance_accessor: false, default: {}
211
+
210
212
  _write_layout_method
211
213
  end
212
214
 
@@ -277,7 +279,7 @@ module ActionView
277
279
  # If a layout is not explicitly mentioned then look for a layout with the controller's name.
278
280
  # if nothing is found then try same procedure to find super class's layout.
279
281
  def _write_layout_method # :nodoc:
280
- remove_possible_method(:_layout)
282
+ silence_redefinition_of_method(:_layout)
281
283
 
282
284
  prefixes = /\blayouts/.match?(_implied_layout_name) ? [] : ["layouts"]
283
285
  default_behavior = "lookup_context.find_all('#{_implied_layout_name}', #{prefixes.inspect}, false, [], { formats: formats }).first || super"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/log_subscriber"
2
4
 
3
5
  module ActionView
@@ -14,7 +16,7 @@ module ActionView
14
16
 
15
17
  def render_template(event)
16
18
  info do
17
- message = " Rendered #{from_rails_root(event.payload[:identifier])}"
19
+ message = " Rendered #{from_rails_root(event.payload[:identifier])}".dup
18
20
  message << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout]
19
21
  message << " (#{event.duration.round(1)}ms)"
20
22
  end
@@ -22,7 +24,7 @@ module ActionView
22
24
 
23
25
  def render_partial(event)
24
26
  info do
25
- message = " Rendered #{from_rails_root(event.payload[:identifier])}"
27
+ message = " Rendered #{from_rails_root(event.payload[:identifier])}".dup
26
28
  message << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout]
27
29
  message << " (#{event.duration.round(1)}ms)"
28
30
  message << " #{cache_message(event.payload)}" unless event.payload[:cache_hit].nil?
@@ -83,7 +85,7 @@ module ActionView
83
85
 
84
86
  def log_rendering_start(payload)
85
87
  info do
86
- message = " Rendering #{from_rails_root(payload[:identifier])}"
88
+ message = " Rendering #{from_rails_root(payload[:identifier])}".dup
87
89
  message << " within #{from_rails_root(payload[:layout])}" if payload[:layout]
88
90
  message
89
91
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "concurrent/map"
2
4
  require "active_support/core_ext/module/remove_method"
3
5
  require "active_support/core_ext/module/attribute_accessors"
@@ -14,11 +16,9 @@ module ActionView
14
16
  class LookupContext #:nodoc:
15
17
  attr_accessor :prefixes, :rendered_format
16
18
 
17
- mattr_accessor :fallbacks
18
- @@fallbacks = FallbackFileSystemResolver.instances
19
+ mattr_accessor :fallbacks, default: FallbackFileSystemResolver.instances
19
20
 
20
- mattr_accessor :registered_details
21
- self.registered_details = []
21
+ mattr_accessor :registered_details, default: []
22
22
 
23
23
  def self.register_detail(name, &block)
24
24
  registered_details << name
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module ModelNaming #:nodoc:
3
5
  # Converts the given object to an ActiveModel compliant one.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView #:nodoc:
2
4
  # = Action View PathSet
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_view"
2
4
  require "rails"
3
5
 
@@ -20,8 +22,15 @@ module ActionView
20
22
  initializer "action_view.form_with_generates_remote_forms" do |app|
21
23
  ActiveSupport.on_load(:action_view) do
22
24
  form_with_generates_remote_forms = app.config.action_view.delete(:form_with_generates_remote_forms)
23
- unless form_with_generates_remote_forms.nil?
24
- ActionView::Helpers::FormHelper.form_with_generates_remote_forms = form_with_generates_remote_forms
25
+ ActionView::Helpers::FormHelper.form_with_generates_remote_forms = form_with_generates_remote_forms
26
+ end
27
+ end
28
+
29
+ initializer "action_view.form_with_generates_ids" do |app|
30
+ ActiveSupport.on_load(:action_view) do
31
+ form_with_generates_ids = app.config.action_view.delete(:form_with_generates_ids)
32
+ unless form_with_generates_ids.nil?
33
+ ActionView::Helpers::FormHelper.form_with_generates_ids = form_with_generates_ids
25
34
  end
26
35
  end
27
36
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/core_ext/module"
2
4
  require "action_view/model_naming"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  # This class defines the interface for a renderer. Each class that
3
5
  # subclasses +AbstractRenderer+ is used by the base +Renderer+ class to
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "concurrent/map"
2
4
  require "action_view/renderer/partial_renderer/collection_caching"
3
5
 
@@ -50,12 +52,12 @@ module ActionView
50
52
  # <%= render partial: "ad", locals: { ad: ad } %>
51
53
  # <% end %>
52
54
  #
53
- # This would first render "advertiser/_account.html.erb" with @buyer passed in as the local variable +account+, then
54
- # render "advertiser/_ad.html.erb" and pass the local variable +ad+ to the template for display.
55
+ # This would first render <tt>advertiser/_account.html.erb</tt> with <tt>@buyer</tt> passed in as the local variable +account+, then
56
+ # render <tt>advertiser/_ad.html.erb</tt> and pass the local variable +ad+ to the template for display.
55
57
  #
56
58
  # == The :as and :object options
57
59
  #
58
- # By default <tt>ActionView::PartialRenderer</tt> doesn't have any local variables.
60
+ # By default ActionView::PartialRenderer doesn't have any local variables.
59
61
  # The <tt>:object</tt> option can be used to pass an object to the partial. For instance:
60
62
  #
61
63
  # <%= render partial: "account", object: @buyer %>
@@ -83,7 +85,7 @@ module ActionView
83
85
  #
84
86
  # <%= render partial: "ad", collection: @advertisements %>
85
87
  #
86
- # This will render "advertiser/_ad.html.erb" and pass the local variable +ad+ to the template for display. An
88
+ # This will render <tt>advertiser/_ad.html.erb</tt> and pass the local variable +ad+ to the template for display. An
87
89
  # iteration object will automatically be made available to the template with a name of the form
88
90
  # +partial_name_iteration+. The iteration object has knowledge about which index the current object has in
89
91
  # the collection and the total size of the collection. The iteration object also has two convenience methods,
@@ -98,7 +100,7 @@ module ActionView
98
100
  #
99
101
  # <%= render partial: "ad", collection: @advertisements, spacer_template: "ad_divider" %>
100
102
  #
101
- # If the given <tt>:collection</tt> is +nil+ or empty, <tt>render</tt> will return nil. This will allow you
103
+ # If the given <tt>:collection</tt> is +nil+ or empty, <tt>render</tt> will return +nil+. This will allow you
102
104
  # to specify a text which will be displayed instead by using this form:
103
105
  #
104
106
  # <%= render(partial: "ad", collection: @advertisements) || "There's no ad to be displayed" %>
@@ -112,18 +114,18 @@ module ActionView
112
114
  #
113
115
  # <%= render partial: "advertisement/ad", locals: { ad: @advertisement } %>
114
116
  #
115
- # This will render the partial "advertisement/_ad.html.erb" regardless of which controller this is being called from.
117
+ # This will render the partial <tt>advertisement/_ad.html.erb</tt> regardless of which controller this is being called from.
116
118
  #
117
- # == \Rendering objects that respond to `to_partial_path`
119
+ # == \Rendering objects that respond to +to_partial_path+
118
120
  #
119
121
  # Instead of explicitly naming the location of a partial, you can also let PartialRenderer do the work
120
- # and pick the proper path by checking `to_partial_path` method.
122
+ # and pick the proper path by checking +to_partial_path+ method.
121
123
  #
122
124
  # # @account.to_partial_path returns 'accounts/account', so it can be used to replace:
123
125
  # # <%= render partial: "accounts/account", locals: { account: @account} %>
124
126
  # <%= render partial: @account %>
125
127
  #
126
- # # @posts is an array of Post instances, so every post record returns 'posts/post' on `to_partial_path`,
128
+ # # @posts is an array of Post instances, so every post record returns 'posts/post' on +to_partial_path+,
127
129
  # # that's why we can replace:
128
130
  # # <%= render partial: "posts/post", collection: @posts %>
129
131
  # <%= render partial: @posts %>
@@ -143,7 +145,7 @@ module ActionView
143
145
  # # <%= render partial: "accounts/account", locals: { account: @account} %>
144
146
  # <%= render @account %>
145
147
  #
146
- # # @posts is an array of Post instances, so every post record returns 'posts/post' on `to_partial_path`,
148
+ # # @posts is an array of Post instances, so every post record returns 'posts/post' on +to_partial_path+,
147
149
  # # that's why we can replace:
148
150
  # # <%= render partial: "posts/post", collection: @posts %>
149
151
  # <%= render @posts %>
@@ -353,7 +355,7 @@ module ActionView
353
355
  # finds the options and details and extracts them. The method also contains
354
356
  # logic that handles the type of object passed in as the partial.
355
357
  #
356
- # If +options[:partial]+ is a string, then the +@path+ instance variable is
358
+ # If +options[:partial]+ is a string, then the <tt>@path</tt> instance variable is
357
359
  # set to that string. Otherwise, the +options[:partial]+ object must
358
360
  # respond to +to_partial_path+ in order to setup the path.
359
361
  def setup(context, options, block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  module CollectionCaching # :nodoc:
3
5
  extend ActiveSupport::Concern
@@ -5,7 +7,7 @@ module ActionView
5
7
  included do
6
8
  # Fallback cache store if Action View is used without Rails.
7
9
  # Otherwise overridden in Railtie to use Rails.cache.
8
- mattr_accessor(:collection_cache) { ActiveSupport::Cache::MemoryStore.new }
10
+ mattr_accessor :collection_cache, default: ActiveSupport::Cache::MemoryStore.new
9
11
  end
10
12
 
11
13
  private
@@ -38,7 +40,7 @@ module ActionView
38
40
  end
39
41
 
40
42
  def expanded_cache_key(key)
41
- key = @view.fragment_cache_key(@view.cache_fragment_name(key, virtual_path: @template.virtual_path))
43
+ key = @view.combined_fragment_cache_key(@view.cache_fragment_name(key, virtual_path: @template.virtual_path))
42
44
  key.frozen? ? key.dup : key # #read_multi & #write may require mutability, Dalli 2.6.0.
43
45
  end
44
46
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionView
2
4
  # This is the main entry point for rendering. It basically delegates
3
5
  # to other objects like TemplateRenderer and PartialRenderer which