Last active
January 3, 2016 01:59
-
-
Save aortbals/8393116 to your computer and use it in GitHub Desktop.
A bash alias to create a rails migration and open it in your editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You should export your editor | |
# `export EDITOR=vim` | |
createMigrationAndOpen() { | |
rails g migration $1 | |
ls db/migrate/* | tail -n1 | xargs $EDITOR | |
} | |
alias migration=createMigrationAndOpen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment