fix(name): default name parameter on options object itself

This commit is contained in:
Mahdi Dibaiee 2016-07-13 10:05:33 +04:30
parent d142e6c553
commit 29ee49fc62
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "hapi-sequelize-crud",
"version": "2.3.0",
"version": "2.3.1",
"description": "Hapi plugin that automatically generates RESTful API for CRUD",
"main": "build/index.js",
"config": {

View File

@ -8,9 +8,9 @@ import qs from 'qs';
const register = (server, options = {}, next) => {
options.prefix = options.prefix || '';
options.name = options.name || 'db';
const name = options.name || 'db';
const db = server.plugins['hapi-sequelize'][name];
const db = server.plugins['hapi-sequelize'][options.name];
const models = db.sequelize.models;
const onRequest = function (request, reply) {