{"issue":{"title":"'belongsto' Relationship breaks if related model is in a different namespace or folder","user":{"login":"tonyeung","id":1285514,"url":"https://api.github.com/users/tonyeung","avatar_url":"https://secure.gravatar.com/avatar/8178c8ebe4437f883d4edef30df19851?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"8178c8ebe4437f883d4edef30df19851"},"created_at":"2011-12-26T03:20:18Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-26T17:00:12Z","id":2656589,"closed_at":null,"html_url":"https://github.com/UnionOfRAD/lithium/issues/220","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"Fatal error: Uncaught exception 'lithium\\core\\ClassNotFoundException' with message 'Related model class 'app\\models\\entities\\People' not found.' in C:\\xampp\\htdocs\\PhiCRM\\libraries\\lithium\\data\\model\\Relationship.php on line 159\r\n\r\nin libraries\\lithium\\data\\model\\Relationship.php on line 115, changed\r\n\r\n    if (!$config['to']) {\r\n        $assoc = preg_replace(\"/\\\\w+$/\", \"\", $config['from']) . $name;\t\r\n        $config['to'] = Libraries::locate('models', $assoc);\r\n    }\r\n\r\nto\r\n\r\n\t    if (!$config['to']) {\r\n        \tif(!$config['class']){\r\n            \t$assoc = preg_replace(\"/\\\\w+$/\", \"\", $config['from']) . $name;  \r\n\t        }\r\n\t        else{\r\n\t            $assoc = $config['class'];\r\n\t        }\r\n\t        $config['to'] = Libraries::locate('models', $assoc);\r\n\t    }\r\n\r\nmy belongsto: \r\n\r\n\tpublic $belongsTo = array(\r\n\t    'People' => array(\r\n\t        'class' => '\\app\\models\\entities\\people\\People',\r\n\t        'key' => 'person_id',\r\n\t\t),\r\n\t);\r\n\r\nmy folder structure(mirrors namespaces)\r\n\r\n* models\r\n    * entities\r\n        * Entities.php\r\n        * people\r\n            * People.php\r\n            * Employees.php\r\n        * organizations\r\n            * ...","number":220,"url":"https://api.github.com/repos/UnionOfRAD/lithium/issues/220","comments":1,"assignee":null},"comment":{"user":{"login":"pointlessjon","id":43869,"url":"https://api.github.com/users/pointlessjon","avatar_url":"https://secure.gravatar.com/avatar/b53341c3e0d7ee964c5585777faae5f2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b53341c3e0d7ee964c5585777faae5f2"},"created_at":"2011-12-26T17:00:12Z","updated_at":"2011-12-26T17:00:12Z","id":3275574,"body":"tony: solution seems solid. maybe initiate a pull request and don't forget to add some tests ;)","url":"https://api.github.com/repos/UnionOfRAD/lithium/issues/comments/3275574"},"action":"created"}