mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 01:49:10 +00:00
chore: prettier Server
This commit is contained in:
parent
d08c9e4829
commit
5119e1142c
5 changed files with 16 additions and 16 deletions
|
@ -2,12 +2,12 @@ const log = new (require('../logger'))('models/index')
|
|||
const glob = require('glob')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = sql => {
|
||||
module.exports = (sql) => {
|
||||
const models = {}
|
||||
const modelFiles = glob.sync('./models/**/!(index).js')
|
||||
log.debug('found models', modelFiles)
|
||||
|
||||
modelFiles.forEach(v => {
|
||||
modelFiles.forEach((v) => {
|
||||
let name = path.basename(v).replace('.js', '')
|
||||
if (v === './models/index.js') {
|
||||
log.debug('index.js hit, skipped')
|
||||
|
@ -23,7 +23,7 @@ module.exports = sql => {
|
|||
}
|
||||
})
|
||||
|
||||
Object.keys(models).forEach(v => {
|
||||
Object.keys(models).forEach((v) => {
|
||||
if (models[v].hasOwnProperty('__associations')) {
|
||||
models[v].__associations(models)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue