check duplicate batch no

This commit is contained in:
Sunandar
2017-02-24 14:19:25 +06:30
parent 93085271a9
commit c784057d1b
2 changed files with 23 additions and 15 deletions

View File

@@ -26,9 +26,11 @@ namespace :setup do
task :set_product_category, [:name,:product_type] => :environment do |t, args|
find_product_type=ProductType.find_by_id(args.product_type)
if !find_product_type.nil?
find_product_category=ProductCategory.find_by_name(args.name)
if find_product_category.nil?
product_category=ProductCategory.new
product_category.name=args.name
product_category.product_type_id=args.product_type