aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorlsylvester <lachlan.sylvester@hypothetical.com.au>2018-10-01 09:50:57 +1000
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-09-30 16:50:57 -0700
commit9d7d6336d79149c9932854517a777c3b304d7fdf (patch)
tree02400a8bfad7e3033d6badf540d631fba050183b /actionview/lib
parent09f92a1b9883927dbeda23a0cc145a2a62a9df60 (diff)
downloadrails-9d7d6336d79149c9932854517a777c3b304d7fdf.tar.gz
rails-9d7d6336d79149c9932854517a777c3b304d7fdf.tar.bz2
rails-9d7d6336d79149c9932854517a777c3b304d7fdf.zip
make actionview templates marshalable so that they can be serialized during the parallel tests (#34030)
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/template.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index 18a5dae270..2dfb14ab46 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -235,6 +235,15 @@ module ActionView
end
end
+ def marshal_dump
+ [ @source, @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @formats, @variants ]
+ end
+
+ def marshal_load(array)
+ @source, @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @formats, @variants = *array
+ @compile_mutex = Mutex.new
+ end
+
private
# Compile a template. This method ensures a template is compiled