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
Add an --editor option to ActiveRecord migration generator #5829
Add an --editor option to ActiveRecord migration generator #5829
Conversation
… an editor after creation
I can dig it +1 |
🏩 |
Even better to configure your editor such that you can generate your migration without ever having to leave it! |
+1 |
+1 @travisjeffery that woud be an editor plugin. |
+1 <3 |
It would be cool if you specified |
@samsoffes that is how it operates, see the description for that option |
Ah |
+1 |
2 similar comments
+1 |
👍 |
Its like sitting in a room at dusk while it gets progressively darker, only for someone to walk in, flip a switch and have you realise whats been missing the past 2 hours! + 1 fo sho! |
❤️ |
Probably best if you continue to return path from the method, otherwise awesome and useful :) +1 |
+1 |
Oh man, I'm not sure how I feel about the particular solution to this problem, but I feel this pain every time I run |
@steveklabnik I hear ya - is there a more general or useful way I should investigate? I'm not wedded to this implementation |
I'll give it some thought, but I'm not sure, to be honest. It's that it's different than every other generator that bugs me, the lack of symmetry. Then again, none of them do this... |
Anything that means I don't have to open my migrations folder (or worse, type in the file name datestamp) is a win. +1 |
That being said, I do understand @steveklabnik's objection. Maybe this doesn't belong in rails core, but would work better as a Guard gem that automatically opens any newly created file in the migrations folder? I'm not just suggesting it so I can install and begin using it right away, either. Honest. |
I'm not sure about the lazy default though, it's not rare that I generate a migration and I run it right away. Edit: maybe that's what it does already, I'm just not sure what lazy_default does. |
I want this every time I generate a migration. What are the objections for not merging it, exactly? @steveklabnik I completely agree with you about the mess that is the various rails and rake commands. However, that does not invalidate this simple patch. @tenderlove any chance this gets pulled in? |
I think that this can be pulled in but I want to propose get this is a higher level. We can define this option in every generator and open the lead file from it. For example: To a controller generator we can open the controller file. Same with models, resources, etc. @subelsky can you change it? |
Agreed, that would be useful. |
2 months without any answer, so I'm closing this one. Feel free to open a new request with the changes that I required. |
@rafaelfranca sorry, I did not see your request from two months ago. I'll get on it this week. |
Hi, I've opened a new pull request at #8553, which opens all generated files, instead of just migrations. |
Hi all, if you want to use the
(Since Rails 3 isn't accepting new features.) See my blog post if you want to use it globally for all Rails 3 apps. |
the first thing Rails devs do after running a migration is usually open that file in an editor. I added an --editor option here that does this for you automatically. I didn't see an easy way to test this (do the generators have their own tests?) but if there's a place where that should go, I'll gladly add them to this patch.