From 66c935e5c6687eb85557ab85ba12953309d7cc14 Mon Sep 17 00:00:00 2001 From: Craig McNamara Date: Wed, 2 Apr 2014 00:44:05 -0700 Subject: [PATCH] Make the meat and potatoes of streaming protected. --- lib/active_admin/resource_controller/streaming.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/active_admin/resource_controller/streaming.rb b/lib/active_admin/resource_controller/streaming.rb index de9a8b53f96..1b49eca946e 100644 --- a/lib/active_admin/resource_controller/streaming.rb +++ b/lib/active_admin/resource_controller/streaming.rb @@ -14,6 +14,12 @@ module Streaming module CSVStream + def index + super { |format| format.csv { stream_csv collection } } + end + + protected + def csv_line(resource, columns) columns.map do |column| call_method_or_proc_on resource, column.data @@ -32,10 +38,6 @@ def stream_csv(collection) end end end - - def index - super { |format| format.csv { stream_csv collection } } - end end end end