Skip to content

Instantly share code, notes, and snippets.

@vitaliel
Created September 27, 2018 08:47
Show Gist options
  • Save vitaliel/1e7ae2812630e025f5ff831f0a33dbfb to your computer and use it in GitHub Desktop.
Save vitaliel/1e7ae2812630e025f5ff831f0a33dbfb to your computer and use it in GitHub Desktop.
<%- headers = ['Identifier', 'Service', 'Start time', 'Called Number', 'Duration (seconds)', 'price'] -%>
<%= CSV.generate_line headers -%>
<%- cdrs_collection.find_each do |record| -%>
<%= CSV.generate_line([record.id, record.customer_service.name, record.start, URI.decode(record.called), record.billsec, number_to_currency(record.price)]) -%>
<%- end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment