build shared_article with price_per attribute, rubocop supplier
This commit is contained in:
parent
25985a2629
commit
7ddb6ec0ef
2 changed files with 3 additions and 2 deletions
|
@ -19,8 +19,10 @@ class SharedArticle < ApplicationRecord
|
||||||
:unit_quantity => unit_quantity,
|
:unit_quantity => unit_quantity,
|
||||||
:order_number => number,
|
:order_number => number,
|
||||||
:article_category => ArticleCategory.find_match(category),
|
:article_category => ArticleCategory.find_match(category),
|
||||||
|
:price_per => price_per,
|
||||||
|
:unit_symbol => unit_symbol,
|
||||||
# convert to db-compatible-string
|
# convert to db-compatible-string
|
||||||
:shared_updated_on => updated_on.to_formatted_s(:db)
|
:shared_updated_on => updated_on.to_fs(:db)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -88,7 +88,6 @@ class Supplier < ApplicationRecord
|
||||||
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category])
|
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category])
|
||||||
new_attrs[:tax] ||= FoodsoftConfig[:tax_default]
|
new_attrs[:tax] ||= FoodsoftConfig[:tax_default]
|
||||||
new_article = articles.build(new_attrs)
|
new_article = articles.build(new_attrs)
|
||||||
|
|
||||||
if status.nil?
|
if status.nil?
|
||||||
if article.nil?
|
if article.nil?
|
||||||
new_articles << new_article
|
new_articles << new_article
|
||||||
|
|
Loading…
Reference in a new issue