storefront/app/controllers/workarea/api/storefront/menus_controller.rb in workarea-api-4.4.7 vs storefront/app/controllers/workarea/api/storefront/menus_controller.rb in workarea-api-4.5.0
- old
+ new
@@ -8,10 +8,12 @@
models = Navigation::Menu.all.select(&:active?)
@menus = Workarea::Storefront::MenuViewModel.wrap(models, params)
end
def show
- model = Navigation::Menu.active.find(params[:id])
+ model = Navigation::Menu.find(params[:id])
+ raise InvalidDisplay unless model.active?
+
@menu = Workarea::Storefront::MenuViewModel.wrap(model, params)
end
end
end
end