After quite some fumbling, fixed both the development import and some tests.

This commit is contained in:
Sander Dorigo
2014-07-08 14:04:02 +02:00
parent f6e195736f
commit bd315fb7ce
8 changed files with 91 additions and 21 deletions

View File

@@ -20,6 +20,8 @@ class AccountController extends \BaseController
public function index()
{
$all = $this->accounts->get();
$list = [
'personal' => [],
'beneficiaries' => [],

View File

@@ -13,6 +13,20 @@ class MigrationController extends BaseController
}
public function dev() {
$file = Config::get('dev.import');
if(file_exists($file)) {
$user = User::find(1);
Auth::login($user);
/** @var Firefly\Helper\Migration\MigrationHelperInterface $migration */
$migration = App::make('Firefly\Helper\Migration\MigrationHelperInterface');
$migration->loadFile($file);
if ($migration->validFile()) {
$migration->migrate();
}
}
}
public function index()
{
return View::make('migrate.index');

View File

@@ -26,15 +26,7 @@ class UserController extends BaseController
*/
public function login()
{
// $user = User::find(1);
// Auth::login($user);
// /** @var Firefly\Helper\Migration\MigrationHelperInterface $migration */
// $migration = App::make('Firefly\Helper\Migration\MigrationHelperInterface');
// $file = '/Library/WebServer/Documents/projects/firefly-iii/app/storage/firefly-export-2014-07-06.json';
// $migration->loadFile($file);
// if($migration->validFile()) {
// $migration->migrate();
// }
return View::make('user.login');