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,6 +1,7 @@
# Format for attributes json # Format for attributes json
attr_format = [] attr_format = []
# Format for attributes json # Format for attributes json
if item.item_attributes.count > 0
item.item_attributes.each do|attr_id| item.item_attributes.each do|attr_id|
menu_attr = MenuItemAttribute.find(attr_id) menu_attr = MenuItemAttribute.find(attr_id)
if attr_format.count == 0 if attr_format.count == 0
@@ -20,10 +21,12 @@ item.item_attributes.each do|attr_id|
end end
end end
end end
end
# Format for option json # Format for option json
opt_format = [] opt_format = []
# Format for attributes json # Format for attributes json
if item.item_options.count > 0
item.item_options.each do|opt| item.item_options.each do|opt|
menu_opt = MenuItemOption.find(opt) menu_opt = MenuItemOption.find(opt)
if opt_format.count == 0 if opt_format.count == 0
@@ -43,6 +46,7 @@ item.item_options.each do|opt|
end end
end end
end end
end
#Menu Item Information #Menu Item Information
json.id item.id json.id item.id