-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Overwriting existing controllers when generating a resource limits the utility of the gem. It makes it much more difficult to add Graphiti to an existing application.
Pain point
Adding Graphiti to an existing application with generate graphiti:resource [RESOURCE_NAME] --model=[MODEL_NAME] overwrites the existing controller. You can skip the overwrite, but then the controller code must be written by hand. Also, if you use destroy graphiti:resource... it deletes the controller file whether the generator initially overwrote the file or not. This inflexibility also increases the difficulty of calling the generator inside other custom generators.
Suggested solutions:
- Break out the responsibilities of the
ResourceGeneratorinto separate generators and create a single scaffold generator which incorporates all of the generators- The scaffold generator could have options to exclude specific generators (e.g.
--no-controller)
- The scaffold generator could have options to exclude specific generators (e.g.
- Instead of overwriting controllers, create separate namespaced controllers specifically for Graphiti. The file structure could be sourced from the namespace recorded in
.graphiticfg.yml.
raghubetina, jelaniwoods, th-ad, dineshpanda, arjan0307 and 1 more
Metadata
Metadata
Assignees
Labels
No labels