foodsoft/app/lib/articles_csv.rb
viehlieb fb8ccfea4a 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
2023-01-17 16:35:04 +01:00

43 lines
1,021 B
Ruby

class ArticlesCsv < RenderCsv
include ApplicationHelper
def header
[
Article.human_attribute_name(:availability_short),
Article.human_attribute_name(:order_number),
Article.human_attribute_name(:name),
Article.human_attribute_name(:note),
Article.human_attribute_name(:manufacturer),
Article.human_attribute_name(:origin),
Article.human_attribute_name(:unit),
Article.human_attribute_name(:price),
Article.human_attribute_name(:tax),
Article.human_attribute_name(:deposit),
Article.human_attribute_name(:unit_quantity),
'',
'',
Article.human_attribute_name(:article_category)
]
end
def data
@object.each do |o|
yield [
'',
o.order_number,
o.name,
o.note,
o.manufacturer,
o.origin,
o.unit,
o.price,
o.tax,
o.deposit,
o.unit_quantity,
'',
'',
o.article_category.try(:name)
]
end
end
end