lib/qualtrics/panel_import.rb in qualtrics-0.5.1 vs lib/qualtrics/panel_import.rb in qualtrics-0.5.2

- old
+ new

@@ -12,30 +12,18 @@ def save payload = headers payload['LibraryID'] = library_id payload['ColumnHeaders'] = 1 file = Qualtrics::PanelImportFile.new(@recipients) - payload['Data'] = Faraday::UploadIO.new(file.temp_file, 'text/csv') - post 'importPanel', payload + post 'importPanel', payload, File.read(file.temp_file) true end def headers {}.tap do |import_headers| Qualtrics::RecipientImportRow.fields.each_with_index.map do |field, index| - import_headers[self.class.attributes[field]] = index + 1 + import_headers[field] = index + 1 end end end - - def self.attributes - { - 'email' => 'Email', - 'first_name' => 'FirstName', - 'last_name' => 'LastName', - 'external_ref' => 'ExternalRef', - 'unsubscribed' =>'Unsubscribed', - 'language' => 'Language' - } - end end -end \ No newline at end of file +end