aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionview/lib/action_view/template.rb6
-rw-r--r--actionview/test/template/template_test.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index 09476ceadc..06d3de17b3 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -125,7 +125,7 @@ module ActionView
attr_reader :source, :identifier, :handler, :original_encoding, :updated_at
attr_reader :variable, :format, :variant, :locals, :virtual_path
- def initialize(source, identifier, handler, format: nil, variant: nil, locals: nil, **details)
+ def initialize(source, identifier, handler, format: nil, variant: nil, locals: nil, virtual_path: nil, updated_at: Time.now)
unless format
ActiveSupport::Deprecation.warn "ActionView::Template#initialize requires a format parameter"
format = :html
@@ -142,7 +142,7 @@ module ActionView
@compiled = false
@original_encoding = nil
@locals = locals
- @virtual_path = details[:virtual_path]
+ @virtual_path = virtual_path
@variable = if @virtual_path
base = @virtual_path[-1] == "/" ? "" : File.basename(@virtual_path)
@@ -150,7 +150,7 @@ module ActionView
$1.to_sym
end
- @updated_at = details[:updated_at] || Time.now
+ @updated_at = updated_at
@format = format
@variant = variant
@compile_mutex = Mutex.new
diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb
index 5a24aea173..71fb99115b 100644
--- a/actionview/test/template/template_test.rb
+++ b/actionview/test/template/template_test.rb
@@ -59,7 +59,7 @@ class TestERBTemplate < ActiveSupport::TestCase
def new_template(body = "<%= hello %>", details = {})
details = { format: :html, locals: [] }.merge details
- ActionView::Template.new(body.dup, "hello template", details.fetch(:handler) { ERBHandler }, { virtual_path: "hello" }.merge!(details))
+ ActionView::Template.new(body.dup, "hello template", details.delete(:handler) || ERBHandler, { virtual_path: "hello" }.merge!(details))
end
def render(locals = {})