vendor/rails/actionpack/lib/action_controller/response.rb in radiant-0.8.0 vs vendor/rails/actionpack/lib/action_controller/response.rb in radiant-0.8.1
- old
+ new
@@ -149,12 +149,12 @@
def each(&callback)
if @body.respond_to?(:call)
@writer = lambda { |x| callback.call(x) }
@body.call(self, self)
- elsif @body.is_a?(String)
- @body.each_line(&callback)
+ elsif @body.respond_to?(:to_str)
+ yield @body
else
@body.each(&callback)
end
@writer = callback
@@ -162,9 +162,15 @@
end
def write(str)
@writer.call str.to_s
str
+ end
+
+ def flush #:nodoc:
+ ActiveSupport::Deprecation.warn(
+ 'Calling output.flush is no longer needed for streaming output ' +
+ 'because ActionController::Response automatically handles it', caller)
end
def set_cookie(key, value)
if value.has_key?(:http_only)
ActiveSupport::Deprecation.warn(