Posted By

stephen on 08/25/09


Tagged

rails migration rename column


Versions (?)

rails-reverse-rename-column


 / Published in: Emacs Lisp
 

  1. (defun rails-reverse-rename-column ()
  2. "In a rails migration, from point to end of buffer, reverse the order of renamed columns"
  3. (interactive)
  4. (save-excursion
  5. (while (re-search-forward "rename_column *\"\\([^\"]*\\)\" *, *\"\\([^\"]*\\)\" *, *\"\\([^\"]*\\)\" *$" nil t)
  6. (replace-match "rename_column \"\\1\", \"\\3\", \"\\2\""))))

Report this snippet  

You need to login to post a comment.