lib/production/repositories/product_setup_repo.rb
# Take the attributes to use as where-criteria and return different sets of
# where criteria to use for matching to gtins - from stricter to less strict.
Take the attributes to use as where-criteria and return different sets of
where criteria to use for matching to gtins - from stricter to less strict.
Take the attributes to use as where - criteria and return different sets of where criteria to use for matching to gtins - from stricter to less strict .
def optional_gtin_lookup_attrs(attrs)
      opts = []
      if AppConst::CR_PROD.gtin_lookup_with_inventory_code?
        opts << attrs.merge(standard_pack_code_id: nil)
        opts << attrs.merge(standard_pack_code_id: nil, mark_id: nil)
      else
        opts << attrs.merge(inventory_code_id: nil)
        unless AppConst::CR_PROD.gtin_lookup_with_pack_and_mark?
          opts << attrs.merge(standard_pack_code_id: nil)
          opts << attrs.merge(standard_pack_code_id: nil, mark_id: nil)
          opts << attrs.merge(standard_pack_code_id: nil, inventory_code_id: nil)
          opts << attrs.merge(standard_pack_code_id: nil, mark_id: nil, inventory_code_id: nil)
        end
      end
      opts
    end
def optional_gtin_lookup_attrs ( attrs ) opts = [ ] if AppConst :: CR_PROD . gtin_lookup_with_inventory_code? opts << attrs . merge ( standard_pack_code_id : nil ) opts << attrs . merge ( standard_pack_code_id : nil , mark_id : nil ) else opts << attrs . merge ( inventory_code_id : nil ) unless AppConst :: CR_PROD . gtin_lookup_with_pack_and_mark? opts << attrs . merge ( standard_pack_code_id : nil ) opts << attrs . merge ( standard_pack_code_id : nil , mark_id : nil ) opts << attrs . merge ( standard_pack_code_id : nil , inventory_code_id : nil ) opts << attrs . merge ( standard_pack_code_id : nil , mark_id : nil , inventory_code_id : nil ) end end opts end
Take the attributes to use as where-criteria and return different sets of
where criteria to use for matching to gtins - from stricter to less strict.
Take the attributes to use as where - criteria and return different sets of where criteria to use for matching to gtins - from stricter to less strict .
attrs
<not_specific>