Skip to content

Commit

Permalink
Reverting change made in model constructor to lazily initialize the m…
Browse files Browse the repository at this point in the history
…odelClass variable, making remaining controller tests pass
  • Loading branch information
lorenzo committed Feb 23, 2011
1 parent ff1942d commit 2371ed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/Cake/Controller/Controller.php
Expand Up @@ -317,9 +317,8 @@ public function __construct($request = null) {
if ($this->viewPath == null) {
$this->viewPath = Inflector::underscore($this->name);
}
if (empty($this->uses)) {
$this->modelClass = Inflector::singularize($this->name);
}

$this->modelClass = Inflector::singularize($this->name);
$this->modelKey = Inflector::underscore($this->modelClass);
$this->Components = new ComponentCollection();

Expand All @@ -336,7 +335,7 @@ public function __construct($request = null) {
}

/**
* Provides backwards compatbility avoid problems with empty and isset to alias properties.
* Provides backwards compatibility to avoid problems with empty and isset to alias properties.
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/cases/libs/controller/controller.test.php
Expand Up @@ -578,7 +578,7 @@ function testFlash() {
$this->assertEqual($result, $expected);

App::build(array(
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Controller = new Controller($request);
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
Expand Down

0 comments on commit 2371ed9

Please sign in to comment.