allow to match category names on import/sync

This commit is contained in:
wvengen 2014-05-21 14:12:38 +02:00
parent 16b78ba2a0
commit d9c61b2db3
8 changed files with 30 additions and 6 deletions

View file

@ -148,7 +148,7 @@ class ArticlesController < ApplicationController
no_category = ArticleCategory.new
articles.each do |row|
# fallback to Others category
category = (ArticleCategory.find_by_name(row[:category]) or no_category)
category = (ArticleCategory.find_match(row[:category]) or no_category)
# creates a new article and price
article = Article.new( :name => row[:name],
:note => row[:note],