Permalink
Browse files

Improving model config error messaging.

 - Fixing issues with fixtures for Mongo relationship integration testing
  • Loading branch information...
nateabele committed Dec 5, 2013
1 parent 4fde127 commit 2c4786b932ffa8c03a6b62ce3d7b493b88176e4f
View
@@ -1298,7 +1298,9 @@ public static function &connection() {
if ($conn = $connections::get($name)) {
return $conn;
}
- throw new ConfigException("The data connection `{$name}` is not configured.");
+ $class = get_called_class();
+ $msg = "The data connection `{$name}` is not configured for model `{$class}`.";
+ throw new ConfigException($msg);
}
/**
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Lithium: the most rad php framework
+ *
+ * @copyright Copyright 2013, Union of RAD (http://union-of-rad.org)
+ * @license http://opensource.org/licenses/bsd-license.php The BSD License
+ */
+
+namespace lithium\tests\fixture\model\gallery;
+
+class Comments extends \lithium\data\Model {
+
+ protected $_meta = array('connection' => 'test');
+}
+
+?>
@@ -12,6 +12,7 @@ class Galleries extends \lithium\data\Model {
public $hasMany = array('Images');
+ protected $_meta = array('connection' => 'test');
}
?>
@@ -14,6 +14,7 @@ class Images extends \lithium\data\Model {
public $hasMany = array('ImagesTags', 'Comments');
+ protected $_meta = array('connection' => 'test');
}
?>
@@ -12,6 +12,7 @@ class ImagesTags extends \lithium\data\Model {
public $belongsTo = array('Images', 'Tags');
+ protected $_meta = array('connection' => 'test');
}
?>

0 comments on commit 2c4786b

Please sign in to comment.