Skip to content

Commit

Permalink
Merge 7e4b84e into 615ad51
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevian committed Apr 6, 2017
2 parents 615ad51 + 7e4b84e commit 79c1271
Show file tree
Hide file tree
Showing 24 changed files with 2 additions and 41 deletions.
1 change: 0 additions & 1 deletion providers/CommandsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const ServiceProvider = require('adonis-fold').ServiceProvider

class CommandsProvider extends ServiceProvider {

constructor () {
super()
this.commands = ['Run', 'Rollback', 'Refresh', 'Reset', 'Status']
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/Command.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const CE = require('../Exceptions')
const BaseCommand = Ioc.use('Adonis/Src/Command')

class Command extends BaseCommand {

constructor (Helpers, Migrations, Seeder) {
super()
this.helpers = Helpers
Expand Down Expand Up @@ -108,7 +107,6 @@ class Command extends BaseCommand {
item.queries.forEach((query) => this.log(`>SQL: ${query}`))
})
}

}

module.exports = Command
1 change: 0 additions & 1 deletion src/Commands/Refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const Command = require('./Command')

class Refresh extends Command {

/**
* signature to be used by ace
*
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const Command = require('./Command')

class Reset extends Command {

/**
* signature to be used by ace
*
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Rollback.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const Command = require('./Command')

class Rollback extends Command {

/**
* signature to be used by ace
*
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Run.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Command = require('./Command')
const prettyHrTime = require('pretty-hrtime')

class Run extends Command {

/**
* signature to be used by ace
*
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const Command = require('./Command')

class Seed extends Command {

/**
* signature to be used by ace
*
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Status.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const Command = require('./Command')

class Status extends Command {

/**
* signature to be used by ace
*
Expand Down
12 changes: 0 additions & 12 deletions src/Exceptions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const NE = require('node-exceptions')

class RuntimeException extends NE.RuntimeException {

/**
* default error code to be used for raising
* exceptions
Expand Down Expand Up @@ -68,11 +67,9 @@ class RuntimeException extends NE.RuntimeException {
'E_LOCK_ON_MIGRATIONS'
)
}

}

class InvalidArgumentException extends NE.InvalidArgumentException {

/**
* default error code to be used for raising
* exceptions
Expand Down Expand Up @@ -150,11 +147,9 @@ class InvalidArgumentException extends NE.InvalidArgumentException {
static invalidTrait (code) {
return new this('Make sure you have defined register method on model', code || this.defaultErrorCode, 'E_INVALID_MODEL_TRAIT')
}

}

class ModelNotFoundException extends NE.LogicalException {

/**
* default error code to be used for raising
* exceptions
Expand All @@ -180,11 +175,9 @@ class ModelNotFoundException extends NE.LogicalException {
static raise (message, code) {
return new this(message, code || this.defaultErrorCode, 'E_MISSING_DATABASE_ROW')
}

}

class ModelException extends NE.LogicalException {

/**
* default error code to be used for raising
* exceptions
Expand Down Expand Up @@ -224,11 +217,9 @@ class ModelException extends NE.LogicalException {
static cannotRestore (model, code) {
return this.invalidState(`Cannot restore ${model} model since soft deletes are not enabled`, code)
}

}

class ModelRelationException extends NE.LogicalException {

/**
* default error code to be used for raising
* exceptions
Expand Down Expand Up @@ -310,11 +301,9 @@ class ModelRelationException extends NE.LogicalException {
static undefinedRelation (relation, model, code) {
return new this(`${relation} is not defined on ${model} model as a relationship`, code || this.defaultErrorCode, 'E_MISSING_DATABASE_RELATION')
}

}

class DomainException extends NE.DomainException {

/**
* default error code to be used for raising
* exceptions
Expand Down Expand Up @@ -354,7 +343,6 @@ class DomainException extends NE.DomainException {
static unsafeEnv (message, code) {
return new this(message, code, 'E_UNSAFE_ENVIRONMENT')
}

}

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion src/Factory/DatabaseFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const Ioc = require('adonis-fold').Ioc
const fake = require('./fake')

class DatabaseFactory {

constructor (binding, callback) {
this.dbTable = binding
this.callback = callback
Expand Down
2 changes: 0 additions & 2 deletions src/Factory/ModelFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const Ioc = require('adonis-fold').Ioc
const fake = require('./fake')

class ModelFactory {

constructor (binding, callback) {
this.binding = Ioc.use(binding)
this.callback = callback
Expand Down Expand Up @@ -125,7 +124,6 @@ class ModelFactory {
reset () {
return this.binding.query().truncate()
}

}

module.exports = ModelFactory
1 change: 0 additions & 1 deletion src/Lucid/Model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const validHookTypes = [
* @class
*/
class Model {

constructor (values) {
if (_.isArray(values)) {
throw CE.InvalidArgumentException.bulkInstantiate(this.constructor.name)
Expand Down
2 changes: 0 additions & 2 deletions src/Lucid/QueryBuilder/Serializers/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const _ = require('lodash')
const helpers = require('../helpers')

class BaseSerializer {

constructor (queryBuilder, proxyScope) {
/**
* this is the reference to the proxied query builder.
Expand Down Expand Up @@ -142,7 +141,6 @@ class BaseSerializer {
}
return collection
}

}

module.exports = BaseSerializer
2 changes: 0 additions & 2 deletions src/Lucid/Relations/BelongsTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const CatLog = require('cat-log')
const logger = new CatLog('adonis:lucid')

class BelongsTo extends Relation {

constructor (parent, related, primaryKey, foreignKey) {
super(parent, related)
this.toKey = primaryKey || this.related.primaryKey
Expand Down Expand Up @@ -176,7 +175,6 @@ class BelongsTo extends Relation {
response[value] = results
return response
}

}

module.exports = BelongsTo
2 changes: 0 additions & 2 deletions src/Lucid/Relations/BelongsToMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const util = require('../../../lib/util')
const logger = new CatLog('adonis:lucid')

class BelongsToMany extends Relation {

constructor (parent, related, pivotTable, pivotLocalKey, pivotOtherKey, primaryKey, relatedPrimaryKey) {
super(parent, related)
this.pivotPrefix = '_pivot_'
Expand Down Expand Up @@ -521,7 +520,6 @@ class BelongsToMany extends Relation {
this.withPivot(this.parent.constructor.createTimestamp, this.parent.constructor.updateTimestamp)
return this
}

}

module.exports = BelongsToMany
1 change: 0 additions & 1 deletion src/Lucid/Relations/EagerLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const cf = require('co-functional')
const CE = require('../../Exceptions')

class EagerLoad {

constructor () {
this.instantiate()
}
Expand Down
1 change: 0 additions & 1 deletion src/Lucid/Relations/HasMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Relation = require('./Relation')
const helpers = require('../QueryBuilder/helpers')

class HasMany extends Relation {

constructor (parent, related, primaryKey, foreignKey) {
super(parent, related)
this.fromKey = primaryKey || this.parent.constructor.primaryKey
Expand Down
2 changes: 0 additions & 2 deletions src/Lucid/Relations/HasManyThrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const CE = require('../../Exceptions')
const helpers = require('../QueryBuilder/helpers')

class HasManyThrough extends Relation {

constructor (parent, related, through, primaryKey, foreignKey, throughPrimaryKey, throughForeignKey) {
super(parent, related)
this.through = this._resolveModel(through)
Expand Down Expand Up @@ -277,7 +276,6 @@ class HasManyThrough extends Relation {
* delete () {
throw CE.ModelRelationException.unSupportedMethod('delete', this.constructor.name)
}

}

module.exports = HasManyThrough
2 changes: 0 additions & 2 deletions src/Lucid/Relations/HasOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Relation = require('./Relation')
const CE = require('../../Exceptions')

class HasOne extends Relation {

constructor (parent, related, primaryKey, foreignKey) {
super(parent, related)
this.fromKey = primaryKey || this.parent.constructor.primaryKey
Expand Down Expand Up @@ -123,7 +122,6 @@ class HasOne extends Relation {
* saveMany () {
throw CE.ModelRelationException.unSupportedMethod('saveMany', this.constructor.name)
}

}

module.exports = HasOne
2 changes: 0 additions & 2 deletions src/Lucid/Relations/Relation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const Ioc = require('adonis-fold').Ioc
const CE = require('../../Exceptions')

class Relation {

constructor (parent, related) {
this.parent = parent
this.related = this._resolveModel(related)
Expand Down Expand Up @@ -260,7 +259,6 @@ class Relation {
return yield self.save(relatedInstance)
}, arrayOfInstances)
}

}

module.exports = Relation
1 change: 0 additions & 1 deletion src/Migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let ConfigReference = null
let DatabaseReference = null

class Migrations {

constructor () {
this.database = DatabaseReference
this.migrationsTable = ConfigReference.get('database.migrationsTable', 'adonis_schema')
Expand Down
1 change: 0 additions & 1 deletion test/unit/fixtures/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ module.exports = {
return yield fs.ensureDir(path.join(__dirname, '../storage'))
}
}

1 change: 1 addition & 0 deletions test/unit/lucid.relations.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-expressions */
'use strict'

/**
Expand Down
1 change: 1 addition & 0 deletions test/unit/lucid.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-expressions */
'use strict'

/**
Expand Down

0 comments on commit 79c1271

Please sign in to comment.