build shared_article with price_per attribute, rubocop supplier

This commit is contained in:
viehlieb 2023-02-21 15:19:56 +01:00
parent 25985a2629
commit 7ddb6ec0ef
2 changed files with 3 additions and 2 deletions

View file

@ -19,8 +19,10 @@ class SharedArticle < ApplicationRecord
:unit_quantity => unit_quantity,
:order_number => number,
:article_category => ArticleCategory.find_match(category),
:price_per => price_per,
:unit_symbol => unit_symbol,
# convert to db-compatible-string
:shared_updated_on => updated_on.to_formatted_s(:db)
:shared_updated_on => updated_on.to_fs(:db)
)
end
end

View file

@ -88,7 +88,6 @@ class Supplier < ApplicationRecord
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category])
new_attrs[:tax] ||= FoodsoftConfig[:tax_default]
new_article = articles.build(new_attrs)
if status.nil?
if article.nil?
new_articles << new_article