diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 033fc249a..0acb9af30 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -348,8 +348,8 @@ class Model extends Overloadable { if ($this->useTable === null) { $this->useTable = Inflector::tableize($this->name); } - - if (in_array('settableprefix', get_class_methods($this))) { + $methods = get_class_methods($this); + if (in_array('settableprefix', $methods) || in_array('setTablePrefix', $methods)) { $this->setTablePrefix(); } diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index abef84619..9d8fb5a43 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -4613,7 +4613,7 @@ class ModelTest extends CakeTestCase { $this->loadFixtures('DataTest'); $TestModel =& new DataTest(); - $TestModel->create(array('float' => '')) && $TestModel->save(); + $TestModel->create(array()) && $TestModel->save(); $result = $TestModel->findById($TestModel->id); $this->assertIdentical($result['DataTest']['count'], '0'); $this->assertIdentical($result['DataTest']['float'], '0');