Skip to content

Commit

Permalink
Merge pull request #308 from Turbo87/owner
Browse files Browse the repository at this point in the history
Allow passing "owner" into manualSetup()
  • Loading branch information
danielspaniel authored Oct 20, 2017
2 parents 958a516 + 5c5d656 commit 41680e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions addon/utils/load-scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const scenarioFileRegExp = new RegExp('/scenarios/main$');
*
* @param container
*/
export default function(container) {
let config = container.owner.resolveRegistration('config:environment') || {},
export default function(owner) {
let config = owner.resolveRegistration('config:environment') || {},
{ factoryGuy } = config;
if (factoryGuy && factoryGuy.useScenarios) {
let [Scenario] = requireFiles(scenarioFileRegExp);
Expand Down
8 changes: 5 additions & 3 deletions addon/utils/manual-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import FactoryGuy from '../factory-guy';
import loadFactories from './load-factories';
import loadScenarios from './load-scenarios';

export default function(container) {
FactoryGuy.setStore(container.lookup('service:store'));
export default function(ownerOrContainer) {
let owner = ownerOrContainer.owner || ownerOrContainer;

FactoryGuy.setStore(owner.lookup('service:store'));
FactoryGuy.resetDefinitions();
loadFactories();
loadScenarios(container);
loadScenarios(owner);
}

0 comments on commit 41680e9

Please sign in to comment.