6

Is it possible to configure Rails so that after running rails g migration name_of_migration, it automatically opens that file in TextMate?

tshepang
  • 12,111
  • 21
  • 91
  • 136
ma11hew28
  • 121,420
  • 116
  • 450
  • 651

2 Answers2

5

You could create an alias with this:

alias last_migration='ls db/migrate/* | tail -n1 | xargs open -a "Textmate"'

and then run it from your terminal:

last_migration
adantj
  • 446
  • 4
  • 13
  • 1
    I've to do add `*.rb` to the `ls` filter because it didn't worked for me: `alias last_migration='ls db/migrate/*.rb | tail -n1 | xargs open -a "MyEditor"'` – MaicolBen Feb 10 '16 at 16:05
2

No, but you can generate migration in Textmate, using the following shortcut -

"Shift + Control + M"

Rishav Rastogi
  • 15,484
  • 3
  • 42
  • 47