Created
November 2, 2013 16:57
-
-
Save barelyknown/7281038 to your computer and use it in GitHub Desktop.
additional method for CSV::Rows to convert row to csv with headers. useful for serializing row for Sidekiq jobs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CSV::Row | |
| def to_csv_with_headers | |
| CSV.generate do |csv| | |
| csv << headers | |
| csv << fields | |
| end.to_s | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment