diff --git a/models/behaviors/schemaless.php b/models/behaviors/mongodb_schemaless.php similarity index 90% rename from models/behaviors/schemaless.php rename to models/behaviors/mongodb_schemaless.php index 73ac04d..2da61d2 100644 --- a/models/behaviors/schemaless.php +++ b/models/behaviors/mongodb_schemaless.php @@ -1,6 +1,6 @@ mongoSchema; return $schema + $this->_defaultSchema; } elseif (is_a($Model, 'Model') && !empty($Model->Behaviors)) { - $Model->Behaviors->attach('Mongodb.Schemaless'); + $Model->Behaviors->attach('Mongodb.MongodbSchemaless'); } return $this->deriveSchemaFromData($Model); } diff --git a/tests/cases/datasources/mongodb_source.test.php b/tests/cases/datasources/mongodb_source.test.php index db46913..f929a89 100644 --- a/tests/cases/datasources/mongodb_source.test.php +++ b/tests/cases/datasources/mongodb_source.test.php @@ -489,14 +489,14 @@ public function testSort() { } /** - * testSchemaless method + * testMongodbSchemaless method * * Test you can save to a model without specifying mongodb. * * @return void * @access public */ - public function testSchemaless() { + public function testMongodbSchemaless() { $toSave = array( 'title' => 'A test article', 'body' => str_repeat('Lorum ipsum ', 100), @@ -543,7 +543,7 @@ public function testSchemaless() { * @access public */ public function testSqlComparisonOperators() { - $this->Post->Behaviors->attach('Mongodb.SqlCompatible'); + $this->Post->Behaviors->attach('Mongodb.MongodbSqlCompatible'); for ($i = 1; $i <= 20; $i++) { $data = array( 'title' => $i,