aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/helpers
diff options
context:
space:
mode:
authorZog2018-03-05 09:11:34 +0100
committerZog2018-03-05 09:11:34 +0100
commitea3de6035cdf9fbbcd92f51c90e5a2c5c3400cb3 (patch)
treed35feb918791f94d69ebb97bf1224d8a96b60796 /lib/tasks/helpers
parentc1ac12174b9aff7535a84af9f76d1cda95b750f4 (diff)
downloadchouette-core-ea3de6035cdf9fbbcd92f51c90e5a2c5c3400cb3.tar.bz2
Refs #6068; Export VehicleJourneys
Add a mechanism to allow for several rows in the csv per single object in the collection.
Diffstat (limited to 'lib/tasks/helpers')
-rw-r--r--lib/tasks/helpers/simple_interfaces.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tasks/helpers/simple_interfaces.rb b/lib/tasks/helpers/simple_interfaces.rb
index 68e02e818..1dc051575 100644
--- a/lib/tasks/helpers/simple_interfaces.rb
+++ b/lib/tasks/helpers/simple_interfaces.rb
@@ -2,7 +2,7 @@ module SimpleInterfacesHelper
def self.interface_output_to_csv interface, output_dir
filepath = File.join output_dir, + "#{interface.configuration_name}_#{Time.now.strftime "%y%m%d%H%M"}_out.csv"
cols = %w(line kind event message error)
- if interface.reload.journal.size > 0
+ if interface.reload.journal.size > 0 && interface.journal.first["row"].present?
keys = interface.journal.first["row"].map(&:first)
CSV.open(filepath, "w") do |csv|
csv << cols + keys