Skip to content

Commit 05f46c0

Browse files
committed
feat: to allow config public for Migration model
1 parent d0c26e6 commit 05f46c0

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The usage is based on the node-db-migrate project.
3434

3535
- `enableRest`
3636

37-
[Boolean] : A boolean indicating wether migrate/rollback REST api methods should be exposed on the Migration model. *(default: false)*
37+
[Boolean] : A boolean indicating whether migrate/rollback REST api methods should be exposed on the Migration model. *(default: false)*
3838

3939
- `migrationsDir`
4040

@@ -48,6 +48,10 @@ The usage is based on the node-db-migrate project.
4848

4949
[Array] : ACLs to apply to Migration and MigrationMap models. *(default: [])*
5050

51+
- `public`
52+
53+
[Boolean] : A boolean indicating whether Migration model should be exposed on the StrongLoop API Explorer. *(default: true)*
54+
5155

5256
## Running Migrations
5357

lib/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ module.exports = function(app, options) {
3838
migrationModelSettings.acls = migrationMapModelSettings.acls = options.acls;
3939
}
4040

41+
if (typeof options.public === "undefined") {
42+
migrationModelSettings.public = migrationMapModelSettings.public = true;
43+
} else {
44+
migrationModelSettings.public = migrationMapModelSettings.public = options.public;
45+
}
46+
4147
// Support for loopback 2.x.
4248
if (app.loopback.version.startsWith(2)) {
4349
Object.keys(migrationModelSettings.methods).forEach(key => {

0 commit comments

Comments
 (0)