Permalink
Browse files

Решил выбирать из базы товар полностью во избежания ошибок.

  • Loading branch information...
1 parent b62f861 commit fed5d9eebd637d55f8df0c14e255a368645ec129 @Tyralion Tyralion committed Feb 15, 2013
Showing with 2 additions and 31 deletions.
  1. +2 −31 lib/anlas_import/worker.rb
@@ -174,40 +174,11 @@ def suppliers
def find_item(supplier_code, code_1c, marking_of_goods)
- item = ::Item.only(
-
- :uri,
- :code_1c,
- :supplier_code,
- :marking_of_goods,
- :marking_of_goods_manufacturer,
- :name,
-
- :supplier_purchasing_price,
- :supplier_wholesale_price,
- :purchasing_price,
-
- :available,
- :country,
- :country_code,
- :storehouse,
- :bar_code,
- :weight,
- :gtd_number,
- :unit,
- :unit_code,
-
- :price_type_rate,
- :sale_rate,
- :for_sale
-
- )
-
- item.where({
+ ::Item.where({
supplier_code: supplier_code,
code_1c: code_1c
}).first || \
- item.where({
+ ::Item.where({
marking_of_goods: marking_of_goods
}).first

0 comments on commit fed5d9e

Please sign in to comment.