Skip to content

Commit

Permalink
Update bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonsimaogoncalves committed Oct 16, 2018
1 parent 300e084 commit 1b743d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
Configure::load('api', 'default', true);
} catch (\Exception $e) {
// nothing
}

// Optionally load additional queue config defaults from local app config
if (file_exists(ROOT . DS . 'config' . DS . 'app_rest_api.php')) {
Configure::load('app_rest_api');
}
16 changes: 16 additions & 0 deletions src/Model/Table/ApiRequestsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace RestApi\Model\Table;

use Cake\Core\Configure;
use Cake\ORM\Table;

/**
Expand All @@ -14,6 +15,21 @@
class ApiRequestsTable extends Table
{

/**
* set connection name
*
* @return string
*/
public static function defaultConnectionName()
{
$connection = Configure::read('RestApi.connection');
if (!empty($connection)) {
return $connection;
};

return parent::defaultConnectionName();
}

/**
* Initialize method
*
Expand Down

0 comments on commit 1b743d6

Please sign in to comment.