mevn-orm 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/model.js CHANGED
@@ -19,7 +19,7 @@ default:
19
19
  const DB = knex(config)
20
20
  class Model {
21
21
  #private
22
- static table = pluralize(this.name.toLowerCase())
22
+ static currentTable = pluralize(this.name.toLowerCase())
23
23
  static currentQuery
24
24
  constructor(properties) {
25
25
  for (const key in properties) {
@@ -27,9 +27,9 @@ class Model {
27
27
  }
28
28
  this.fillable = []
29
29
  this.hidden = []
30
- this.#private = ['fillable', 'hidden', 'table']
30
+ this.#private = ['fillable', 'hidden']
31
31
  this.modelName = this.constructor.name.toLowerCase()
32
- this.table = pluralize(this.modelName)
32
+ this.table = pluralize(this.constructor.name.toLowerCase())
33
33
  }
34
34
 
35
35
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mevn-orm",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "simple ORM for express js",
5
5
  "type": "commonjs",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-undef */
2
- const { Model } = require('../index')
2
+ const { Model, DB } = require('../index')
3
3
  const faker = require('faker')
4
4
  const { expect } = require('chai')
5
5
  class Profile extends Model {
@@ -14,6 +14,8 @@ class Farmer extends Model {
14
14
  }
15
15
  }
16
16
 
17
+ DB(Farmer)
18
+
17
19
  describe('#Model tests', () => {
18
20
  it('#Model instance', async () => {
19
21
  const farmer = new Farmer({