update for check for menu item api

This commit is contained in:
Yan
2017-08-24 18:18:52 +06:30
parent 830370dac8
commit fb7ddd947a

View File

@@ -1,7 +1,8 @@
# Format for attributes json
attr_format = []
# Format for attributes json
item.item_attributes.each do|attr_id|
if item.item_attributes.count > 0
item.item_attributes.each do|attr_id|
menu_attr = MenuItemAttribute.find(attr_id)
if attr_format.count == 0
attr_format.push({ type: menu_attr.attribute_type, values: [menu_attr.name] })
@@ -19,12 +20,14 @@ item.item_attributes.each do|attr_id|
break
end
end
end
end
# Format for option json
opt_format = []
# Format for attributes json
item.item_options.each do|opt|
if item.item_options.count > 0
item.item_options.each do|opt|
menu_opt = MenuItemOption.find(opt)
if opt_format.count == 0
opt_format.push({ type: menu_opt.option_type, values: [menu_opt.name] })
@@ -42,6 +45,7 @@ item.item_options.each do|opt|
break
end
end
end
end
#Menu Item Information