Permalink
Browse files

Clear cache of pluralized, singularized and tableize when set rules.

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent 9053291 commit bb0ff192f7e473b0b671facd983401b86ea40a92 @jrbasso jrbasso committed with markstory Apr 21, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 cake/libs/inflector.php
View
@@ -370,6 +370,11 @@ function rules($type, $rules, $reset = false) {
$_this->{$var}[$rule] = array_merge($pattern, $_this->{$var}[$rule]);
}
unset($rules[$rule], $_this->{$var}['cache' . ucfirst($rule)], $_this->{$var}['merged'][$rule]);
+ if ($type === 'plural') {
+ $_this->_pluralized = $_this->_tableize = array();
+ } elseif ($type === 'singular') {
+ $_this->_singularized = array();
+ }
}
}
$_this->{$var}['rules'] = array_merge($rules, $_this->{$var}['rules']);

0 comments on commit bb0ff19

Please sign in to comment.