rails up to 7.0and ruby to 2.7.2
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
This commit is contained in:
parent
d7591d46b9
commit
fb8ccfea4a
53 changed files with 583 additions and 594 deletions
33
app/lib/financial_transactions_csv.rb
Normal file
33
app/lib/financial_transactions_csv.rb
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
require 'csv'
|
||||
|
||||
class FinancialTransactionsCsv < RenderCsv
|
||||
include ApplicationHelper
|
||||
|
||||
def header
|
||||
[
|
||||
FinancialTransaction.human_attribute_name(:created_on),
|
||||
FinancialTransaction.human_attribute_name(:ordergroup),
|
||||
FinancialTransaction.human_attribute_name(:ordergroup),
|
||||
FinancialTransaction.human_attribute_name(:user),
|
||||
FinancialTransaction.human_attribute_name(:financial_transaction_class),
|
||||
FinancialTransaction.human_attribute_name(:financial_transaction_type),
|
||||
FinancialTransaction.human_attribute_name(:note),
|
||||
FinancialTransaction.human_attribute_name(:amount)
|
||||
]
|
||||
end
|
||||
|
||||
def data
|
||||
@object.includes(:user, :ordergroup, :financial_transaction_type).each do |t|
|
||||
yield [
|
||||
t.created_on,
|
||||
t.ordergroup_id,
|
||||
t.ordergroup_name,
|
||||
show_user(t.user),
|
||||
t.financial_transaction_type.financial_transaction_class.name,
|
||||
t.financial_transaction_type.name,
|
||||
t.note,
|
||||
number_to_currency(t.amount)
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue