aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-09-30 16:55:16 -0700
committerGitHub <noreply@github.com>2018-09-30 16:55:16 -0700
commitb707a6d0eb7a694595152c5ca18f1e72e0bc2f7e (patch)
treed28b3f2c4abce04fd239374e13741a713d0f572a /actionview
parent9d7d6336d79149c9932854517a777c3b304d7fdf (diff)
downloadrails-b707a6d0eb7a694595152c5ca18f1e72e0bc2f7e.tar.gz
rails-b707a6d0eb7a694595152c5ca18f1e72e0bc2f7e.tar.bz2
rails-b707a6d0eb7a694595152c5ca18f1e72e0bc2f7e.zip
Explain why we have explicit marshaling methods
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/template.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index 2dfb14ab46..f5f64263da 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -235,11 +235,15 @@ module ActionView
end
end
- def marshal_dump
+
+ # Exceptions are marshaled when using the parallel test runner with DRb, so we need
+ # to ensure that references to the template object can be marshaled as well. This means forgoing
+ # the marshalling of the compiler mutex and instantiating that again on unmarshaling.
+ def marshal_dump # :nodoc:
[ @source, @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @formats, @variants ]
end
- def marshal_load(array)
+ def marshal_load(array) # :nodoc:
@source, @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @formats, @variants = *array
@compile_mutex = Mutex.new
end