Permalink
Browse files

Moving import to fix issue where cakeschema would not be found when b…

…aking models.
  • Loading branch information...
1 parent dc07a05 commit f81d3da1751968a0ad664ebff10fb7c1f0902937 @markstory markstory committed Nov 4, 2009
Showing with 3 additions and 4 deletions.
  1. +3 −4 cake/console/libs/tasks/fixture.php
View
7 cake/console/libs/tasks/fixture.php
@@ -82,10 +82,6 @@ function __construct(&$dispatch) {
* @access public
*/
function execute() {
- if (!class_exists('CakeSchema')) {
- App::import('Model', 'CakeSchema', false);
- }
-
if (empty($this->args)) {
$this->__interactive();
}
@@ -176,6 +172,9 @@ function importOptions($modelName) {
* @access private
*/
function bake($model, $useTable = false, $importOptions = array()) {
+ if (!class_exists('CakeSchema')) {
+ App::import('Model', 'CakeSchema', false);
+ }
$table = $schema = $records = $import = $modelImport = $recordImport = null;
if (!$useTable) {
$useTable = Inflector::tableize($model);

0 comments on commit f81d3da

Please sign in to comment.