fix rubocop and add translations

This commit is contained in:
viehlieb 2023-02-20 21:44:57 +01:00
parent 346e985c49
commit 126015ca67
8 changed files with 20 additions and 17 deletions

View file

@ -82,9 +82,8 @@ class Supplier < ApplicationRecord
FoodsoftFile::parse file, options do |status, new_attrs, line|
article = articles.undeleted.where(order_number: new_attrs[:order_number]).first
unless new_attrs[:article_category].blank?
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category]) ? ArticleCategory.find_match(new_attrs[:article_category]) : ArticleCategory.create_or_find_by!(name: new_attrs[:article_category])
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category]) || ArticleCategory.create_or_find_by!(name: new_attrs[:article_category])
end
new_attrs[:tax] ||= FoodsoftConfig[:tax_default]
@ -94,7 +93,7 @@ class Supplier < ApplicationRecord
if article.nil?
new_articles << new_article
else
unequal_attributes = article.unequal_attributes(new_article, options.slice(:convert_units,:update_category))
unequal_attributes = article.unequal_attributes(new_article, options.slice(:convert_units, :update_category))
unless unequal_attributes.empty?
article.attributes = unequal_attributes
updated_article_pairs << [article, unequal_attributes]