Skip to content

Commit

Permalink
Clear cache of pluralized, singularized and tableize when set rules.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information
jrbasso authored and markstory committed Apr 22, 2010
1 parent 9053291 commit bb0ff19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cake/libs/inflector.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ function rules($type, $rules, $reset = false) {
$_this->{$var}[$rule] = array_merge($pattern, $_this->{$var}[$rule]); $_this->{$var}[$rule] = array_merge($pattern, $_this->{$var}[$rule]);
} }
unset($rules[$rule], $_this->{$var}['cache' . ucfirst($rule)], $_this->{$var}['merged'][$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']); $_this->{$var}['rules'] = array_merge($rules, $_this->{$var}['rules']);
Expand Down

0 comments on commit bb0ff19

Please sign in to comment.