# Strange error in development mode in 2.3.2 when streaming data

**URL:** <https://www.ruby-forum.com/t/strange-error-in-development-mode-in-2-3-2-when-streaming-data/163967>\
**Category:** Rails\
**Created:** [March 26, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/strange-error-in-development-mode-in-2-3-2-when-streaming-data/163967 "2009-03-26T15:23:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 26, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/strange-error-in-development-mode-in-2-3-2-when-streaming-data/163967/1 "2009-03-26T15:23:33Z")

</div>

I’ve recently upgraded to 2.3.2 from 2.2.2. We used to have code in  
our controller that streamed data back to the browser in chunks, and  
that no longer works in 2.3.2. It seems to be messing up the  
dependency-loading mechanism. Here’s a simplified version of the code:

# visitor.rb

class Visitor \< ActiveRecord::Base  
has\_many :events  
end

# event.rb

class Event \< ActiveRecord::Base  
belongs\_to :visitor  
end

# Now the interesting part…

class MyController \< ActionController::Base

def index  
render :status =\> 200, :layout =\> false,  
:text =\> Proc.new { |response, output| output.write  
Visitor.first.events.inspect }  
end

The error we get is:

A copy of Admin::VisitorEventsController has been removed from the  
module tree but is still active!

This only happens if we try to reference an ActiveRecord model within  
the proc. We can’t move our code out of the proc, because the whole  
idea is that we’ll be streaming data that’s being dynamically  
generated inside the proc.

Anybody else seen this?

Thanks  
Jeff
