diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-02 18:07:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-02 18:07:15 +0300 |
commit | b3432e3b6d3ad4baf73847907c4fea91b59288a5 (patch) | |
tree | 67faa17d1769222861e9ff11568ca770d38766e1 /lib/csv_builders | |
parent | 7069eb1ee6cd6af1fa769df5a1175dffc4e3ddb1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/csv_builders')
-rw-r--r-- | lib/csv_builders/single_batch.rb | 11 | ||||
-rw-r--r-- | lib/csv_builders/stream.rb | 17 |
2 files changed, 0 insertions, 28 deletions
diff --git a/lib/csv_builders/single_batch.rb b/lib/csv_builders/single_batch.rb deleted file mode 100644 index bed6b7424b3..00000000000 --- a/lib/csv_builders/single_batch.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module CsvBuilders - class SingleBatch < CsvBuilder - protected - - def each(&block) - @collection.each(&block) - end - end -end diff --git a/lib/csv_builders/stream.rb b/lib/csv_builders/stream.rb deleted file mode 100644 index a2b9fca84cb..00000000000 --- a/lib/csv_builders/stream.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module CsvBuilders - class Stream < CsvBuilder - def render(max_rows = 100_000) - max_rows_including_header = max_rows + 1 - - Enumerator.new do |csv| - csv << CSV.generate_line(headers) - - each do |object| - csv << CSV.generate_line(row(object)) - end - end.lazy.take(max_rows_including_header) # rubocop: disable CodeReuse/ActiveRecord - end - end -end |