Migrate ToCsv module to CsvGenerator service

This commit is contained in:
Thiago Youssef 2022-04-01 10:59:04 +03:00
parent daafa756aa
commit e50501f13f
16 changed files with 34 additions and 60 deletions

View file

@ -188,15 +188,6 @@ class Contact < ApplicationRecord
]
end
def to_csv
CSV.generate do |csv|
csv << column_names
all.each do |contact|
csv << contact.attributes.values_at(*column_names)
end
end
end
def pdf(html)
kit = PDFKit.new(html)
kit.to_pdf