We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 34c55b0 + afe1398 commit 464440cCopy full SHA for 464440c
2 files changed
lib/rails_admin/support/csv_converter.rb
@@ -4,6 +4,9 @@
4
module RailsAdmin
5
class CSVConverter
6
def initialize(objects = [], schema = {})
7
+ @fields = []
8
+ @associations = []
9
+
10
return self if (@objects = objects).blank?
11
12
@model = objects.dup.first.class
spec/rails_admin/support/csv_converter_spec.rb
@@ -112,5 +112,14 @@
112
end
113
114
115
116
+ context "when objects is empty" do
117
+ let(:objects) { [] }
118
+ let(:options) { {} }
119
120
+ it "generates an empty csv" do
121
+ expect(subject[2]).to eq("\n")
122
+ end
123
124
125
0 commit comments