Skip to content

Commit

Permalink
Fix double pluralization.
Browse files Browse the repository at this point in the history
Controller and association names are already plural by convention.
Pluralizing them again creates problem for irregular plurals like "Salesmen".
  • Loading branch information
ADmad committed Jun 4, 2016
1 parent 0794fa1 commit 191d5df
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,6 @@ protected function _controllerName()
'humanize',
];

if ($this->_action()->scope() === 'table') {
$inflections[] = 'pluralize';
}

if ($this->_action()->scope() === 'entity') {
$inflections[] = 'singularize';
}
Expand Down Expand Up @@ -484,7 +480,7 @@ protected function _associations(array $whitelist = [])
$associationConfiguration[$type][$assocKey]['foreignKey'] = $association->foreignKey();
$associationConfiguration[$type][$assocKey]['propertyName'] = $association->property();
$associationConfiguration[$type][$assocKey]['plugin'] = null;
$associationConfiguration[$type][$assocKey]['controller'] = Inflector::pluralize($assocKey);
$associationConfiguration[$type][$assocKey]['controller'] = $assocKey;
$associationConfiguration[$type][$assocKey]['entity'] = Inflector::singularize(Inflector::underscore($assocKey));
$associationConfiguration[$type][$assocKey]['entities'] = Inflector::underscore($assocKey);

Expand Down

0 comments on commit 191d5df

Please sign in to comment.