From 4719006735b4f45ea71d23cb83f531701822b19e Mon Sep 17 00:00:00 2001 From: Andreas Steinel Date: Fri, 19 Feb 2016 14:52:13 +0100 Subject: [PATCH] Infer migration class name This small change infers the class name automatically --- snippets/rails.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/rails.snippets b/snippets/rails.snippets index 6018621..e834222 100644 --- a/snippets/rails.snippets +++ b/snippets/rails.snippets @@ -348,7 +348,7 @@ snippet mct ${0} end snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end - class ${1:class_name} < ActiveRecord::Migration + class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration def up ${0} end @@ -357,7 +357,7 @@ snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. en end end snippet migration class .. < ActiveRecord::Migration .. def change .. end - class ${1:class_name} < ActiveRecord::Migration + class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration def change ${0} end