aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/flows.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/flows.rb')
-rw-r--r--actionpack/lib/action_view/flows.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/flows.rb b/actionpack/lib/action_view/flows.rb
index b5e2c5d37d..995a0b51e4 100644
--- a/actionpack/lib/action_view/flows.rb
+++ b/actionpack/lib/action_view/flows.rb
@@ -19,6 +19,10 @@ module ActionView
def append(key, value)
@content[key] << value
end
+
+ def append!(key, value)
+ @content[key] << value
+ end
end
class StreamingFlow < OutputFlow
@@ -58,6 +62,11 @@ module ActionView
# by provides and resumes back to the fiber if it is
# the key it is waiting for.
def set(key, value)
+ @content[key] = (ActiveSupport::SafeBuffer.new << value)
+ end
+
+ # Append but also resume the fiber if it provided the right key.
+ def append!(key, value)
super
@fiber.resume if @waiting_for == key
end