Last active
January 23, 2019 07:27
-
-
Save manojmj92/832fc6321b52becca1277c5a727a9891 to your computer and use it in GitHub Desktop.
Revisions
-
manojmj92 revised this gist
Jan 23, 2019 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ def generate_csv(column_names, records) CSV.generate do |csv| csv << column_names # add headers to the CSV records.each do |record| csv << record.attributes.values_at(*column_names) end end end -
manojmj92 revised this gist
Jan 21, 2019 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,9 @@ def generate_csv(column_names, records) CSV.generate do |csv| csv << column_names # add headers to the CSV records.each do |record| csv << record.attributes.values_at(*column_names) end end end -
manojmj92 created this gist
Jan 21, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ def generate_csv(column_names, records) CSV.generate do |csv| csv << column_names # add headers to the CSV records.each do |record| csv << record.attributes.values_at(*column_names) end end end