Skip to content

Commit

Permalink
fix(namespace): ioc.use returns the class, not an instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Huwiler committed Feb 23, 2019
1 parent cb2a983 commit 69d2855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Bumblebee/Scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Scope {
_getTransformerInstance (Transformer) {
// if the transformer is a string, use the IoC to fetch the instance.
if (typeof Transformer === 'string') {
return ioc.use(Transformer)
Transformer = ioc.use(Transformer)
}

// if the transformer is a class, create a new instance
Expand Down
2 changes: 1 addition & 1 deletion test/transformer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PrimitiveTransformer extends TransformerAbstract {

test.group('Transformer', () => {
test('a transformer can be resolved using its namespace', async (assert) => {
ioc.bind('App/Transformers/IDTransformer', () => new IDTransformer())
ioc.bind('App/Transformers/IDTransformer', () => IDTransformer)

let data = { item_id: 3 }

Expand Down

0 comments on commit 69d2855

Please sign in to comment.