Infer migration class name

This small change infers the class name automatically
This commit is contained in:
Andreas Steinel 2016-02-19 14:52:13 +01:00
parent 122134f9fa
commit 4719006735

View File

@ -348,7 +348,7 @@ snippet mct
${0} ${0}
end end
snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. 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 def up
${0} ${0}
end end
@ -357,7 +357,7 @@ snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. en
end end
end end
snippet migration class .. < ActiveRecord::Migration .. def change .. 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 def change
${0} ${0}
end end