Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdirectories are not supported #540

Closed
kevintraver opened this issue Jan 29, 2016 · 5 comments
Closed

Subdirectories are not supported #540

kevintraver opened this issue Jan 29, 2016 · 5 comments

Comments

@kevintraver
Copy link

When running:

ember g mirage-model foo/bar

The following error occurs when trying to access the route:

Assertion Failed: Subdirectories under foo are not supported

A related question:

How would you see Pods structure working with ember-cli-mirage?

Thanks!

@samselikoff
Copy link
Collaborator

It looks like they aren't supported by default - have you seen any other addons use this? Also, have you tried creating the file manually? It may just be the generator that doesn't work.

I haven't thought about pods and Mirage. I use pods in my Ember apps and Mirage's default structure suits me. Any particular problem you're facing?

@mattmarcum
Copy link

@samselikoff the generator works fine and doesn't throw any errors. That assertion gets thrown by the ember-cli-mirage initializer when its reading in the modules on application boot up in the browser.

https://github.com/samselikoff/ember-cli-mirage/blob/master/addon/utils/read-modules.js#L32

Thats the function and assertion that gets called by the initializer.

I'm trying to port over an old pretender based fixture system to ember-mirage and it was going greate till I hit a nested resource.

@kevintraver
Copy link
Author

@samselikoff I was just thinking Pods because if you have nested resources in your app, then it would be awesome if Mirage reflected that structure as well.

I guess a potential issue would be if you have two models with the same name under different namespaces.

@samselikoff
Copy link
Collaborator

I see. We should definitely support nested resources. I'm focused on other 0.2.0 issues at the moment, so if anyone else wants to spearhead this, I would start by making an app with nested resources, and taking a look at options.models in the Server constructor, as well as what ends up in schema._registry after all the models are registered.

@samselikoff
Copy link
Collaborator

Filing under the "Subdirectory support" card on the Roadmap project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants