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

*Suggestion* default generation target path #33

Open
focused opened this issue Mar 19, 2020 · 0 comments
Open

*Suggestion* default generation target path #33

focused opened this issue Mar 19, 2020 · 0 comments

Comments

@focused
Copy link

focused commented Mar 19, 2020

Suggestion

Change default generation target path of mix task mix waffle.g to "data" application.

Reasoning

Let's say i have a crawler application for example, and it consists of three subapplications: "ecto" part, "crawl" part, and "CLI" part, there is no "web" application with controllers, views and templates:

my_app/
| lib/
| | my_app/
| | my_app_crawler/
| | my_app_cli/

"Crawler" app and "CLI" app may fetch images from remote host or process from user input in console - two different ways of getting image data. I want to have one place to describe transformation and storing image data process, so it's obviously should be put into "data" application, because "data" applications are responsible for storing/validation, not "web" applications.

Actual behaviour (it puts generated uploader under "/lib/#{app_name}_web/uploaders/"):

model_destination = Path.join(File.cwd!, "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex")

Example

New skeleton would look like this:

lib/
| | my_app/
| | | accounts/
| | | | profile.ex
| | | | profile_uploader.ex
| | | | user.ex
| | | | user_key_uploader.ex
| | | shared/
| | | | attachment_uploader.ex
| | | accounts.ex
...
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

1 participant