Create ActiveRecord migration then edit in one step?


Create ActiveRecord migration then edit in one step?



I find myself doing this a lot:

script/generate migration my_new_migration 

.. then select & copy the generated filename, then paste it into vi to actually write the migration.

Is there any way to do this in one step? i.e. when the script/generate migration runs, it creates the file the automatically opens that file in an editor?

(I'm working in an SSH terminal window on linux..)


How can I figure out why cURL is hanging and unresponsive?

1:

Linux - Want To Check For Possible Duplicate Directories (Probably RegEx Needed)
Maybe you must edit generator script. How to track the memory usage in C++When file is generated than exec $EDITOR [new_file] or any thing like that?. How to completely wipe rubygems along with rails etc
C functions invoked as threads - Linux userland programHow to detect pending system shutdown on Linux?

2:

How can I setup my Netbeans IDE for making Java ME applications?
Thanks for the suggestions. Buffering of stream data However, I actually just stumbled upon this: http://www.vim.org/scripts/script.php?script_id=1567. Pretty sweet, as it lets you did .
> :Rscript generate migration my_migration 
.. from inside VIM, and it will automatically generate the migration then load it up in the editor for you. .


60 out of 100 based on 35 user ratings 470 reviews