Skip to content

Instantly share code, notes, and snippets.

@aortbals
Last active January 3, 2016 01:59
Show Gist options
  • Save aortbals/8393116 to your computer and use it in GitHub Desktop.
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
# 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