fixes on assets

This commit is contained in:
Parziphal 2013-10-26 16:18:43 -05:00
parent a70f9cbfdb
commit f4c03a4a80
3 changed files with 13 additions and 10 deletions

View File

@ -38,7 +38,7 @@ class ModelSchema
public function schemaFile()
{
$path = Rails::root() . '/db/table_schema/' . $this->connection_name();
$path = Rails::root() . '/db/table_schema/' . $this->connection->name();
$file = $path . '/' . $this->name . '.php';
return $file;
}
@ -51,7 +51,7 @@ class ModelSchema
$this->loadCachedSchema();
} elseif (!$this->getSchema()) {
throw new Exception\RuntimeException(
sprintf("Couldn't find schema for %s: %s", $this->name, $this->error_stmt)
sprintf("Couldn't find schema for %s", $this->name)
);
}
}

View File

@ -93,6 +93,12 @@ class AdminController extends ApplicationController
Rails\Assets\Parser\Javascript\ClosureApi\ClosureApi::errorFile(), $e->getMessage());
$this->error = $message;
} catch (\Exception $e) {
/**
* If another error occurs, it won't be properly shown because of production config.
*/
Rails::resetConfig('development');
throw $e;
}
Rails::resetConfig('development');

View File

@ -130,14 +130,11 @@ final class Rails
$prefix = str_replace('\\', '/', self::$config->assets->prefix);
$router = self::application()->router();
if (!$router || !$router->route() || !$router->route()->isPanelRoute()) {
$basePaths = [
str_replace('\\', '/', Rails::config()->paths->application) . $prefix,
str_replace('\\', '/', Rails::root() . '/lib') . $prefix,
str_replace('\\', '/', Rails::root() . '/vendor') . $prefix,
];
}
$basePaths = [
str_replace('\\', '/', Rails::config()->paths->application) . $prefix,
str_replace('\\', '/', Rails::root() . '/lib') . $prefix,
str_replace('\\', '/', Rails::root() . '/vendor') . $prefix,
];
$paths = [];