viehlieb
fb8ccfea4a
mv lib to app/lib due to upgrade removing concerns from autoload path resolve zeitwerk issues make foodsoft run for dev on rails 7 and ruby 2.7 fix mail file permission bug fix database_config fix articles controller test ActiveModell::Error bump Gemfile.lock
29 lines
617 B
Ruby
29 lines
617 B
Ruby
require 'csv'
|
|
|
|
class BankTransactionsCsv < RenderCsv
|
|
include ApplicationHelper
|
|
|
|
def header
|
|
[
|
|
BankTransaction.human_attribute_name(:external_id),
|
|
BankTransaction.human_attribute_name(:date),
|
|
BankTransaction.human_attribute_name(:amount),
|
|
BankTransaction.human_attribute_name(:iban),
|
|
BankTransaction.human_attribute_name(:reference),
|
|
BankTransaction.human_attribute_name(:text)
|
|
]
|
|
end
|
|
|
|
def data
|
|
@object.each do |t|
|
|
yield [
|
|
t.external_id,
|
|
t.date,
|
|
t.amount,
|
|
t.iban,
|
|
t.reference,
|
|
t.text
|
|
]
|
|
end
|
|
end
|
|
end
|