From 63ae64191fbab7ce716257a25a3c15307e7be6c5 Mon Sep 17 00:00:00 2001 From: "Alberto G. Rodriguez" Date: Mon, 11 Mar 2024 12:49:30 -0400 Subject: [PATCH] fix: add singularAlias param on associations hasMany (#980) Fix singularized variable name in template --- templates/bake/Template/view.twig | 2 +- tests/comparisons/Template/testBakeView.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/bake/Template/view.twig b/templates/bake/Template/view.twig index ae63d0e2..76192e48 100644 --- a/templates/bake/Template/view.twig +++ b/templates/bake/Template/view.twig @@ -118,7 +118,7 @@ {% endif %} {% set relations = associations.BelongsToMany|merge(associations.HasMany) %} {% for alias, details in relations %} -{% set otherSingularVar = alias|variable %} +{% set otherSingularVar = alias|singularize|variable %} {% set otherPluralHumanName = details.controller|underscore|humanize %}