diff options
Diffstat (limited to 'actionpack/lib/action_view/flows.rb')
-rw-r--r-- | actionpack/lib/action_view/flows.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/flows.rb b/actionpack/lib/action_view/flows.rb index b81a34002a..b5e2c5d37d 100644 --- a/actionpack/lib/action_view/flows.rb +++ b/actionpack/lib/action_view/flows.rb @@ -22,8 +22,11 @@ module ActionView end class StreamingFlow < OutputFlow - def initialize(flow, fiber) - @content = flow.content + def initialize(view, fiber) + @view = view + @parent = nil + @child = view.output_buffer + @content = view._view_flow.content @fiber = fiber @root = Fiber.current.object_id end @@ -36,11 +39,15 @@ module ActionView return super if @content.key?(key) if inside_fiber? + view = @view + begin @waiting_for = key + view.output_buffer, @parent = @child, view.output_buffer Fiber.yield ensure @waiting_for = nil + view.output_buffer, @child = @parent, view.output_buffer end end |