Skip to content

Commit

Permalink
Place requires inside providers register method
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Sep 15, 2015
1 parent ca02321 commit cfe08b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions providers/CollectionProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
*/

const ServiceProvider = require('adonis-fold').ServiceProvider
const Collection = require('../src/Orm/Collection')

class CollectionProvider extends ServiceProvider{

* register() {
this.app.bind('Adonis/Src/Collection', function () {
return Collection;
return require('../src/Orm/Collection')
})
}

Expand Down
2 changes: 1 addition & 1 deletion providers/DatabaseProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

const ServiceProvider = require('adonis-fold').ServiceProvider
const Database = require('../src/Database')

class DatabaseProvider extends ServiceProvider{

Expand All @@ -17,6 +16,7 @@ class DatabaseProvider extends ServiceProvider{

* register() {
this.app.singleton('Adonis/Src/Database', function (Env,Config) {
const Database = require('../src/Database')
return new Database(Env,Config)
})
}
Expand Down
2 changes: 1 addition & 1 deletion providers/LucidProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

const ServiceProvider = require('adonis-fold').ServiceProvider
const Lucid = require('../src/Orm/Proxy/Model')

class LucidProvider extends ServiceProvider{

Expand All @@ -17,6 +16,7 @@ class LucidProvider extends ServiceProvider{

* register() {
this.app.bind('Adonis/Src/Lucid', function (Database) {
const Lucid = require('../src/Orm/Proxy/Model')
Lucid.database = Database
return Lucid
})
Expand Down

0 comments on commit cfe08b0

Please sign in to comment.