closure_tree icon indicating copy to clipboard operation
closure_tree copied to clipboard

closure_tree:migration yields non plural class name

Open richkuo opened this issue 11 years ago • 4 comments

rails g closure_tree:migration tag

yields a migration file that contains non pluralized class name:

class CreateTagHierarchy

which should be:

class CreateTagHierarchies

this prevents rake db:migrate from running correctly

richkuo avatar Oct 08 '14 17:10 richkuo

/lib/generators/closure_tree/migration_generator.rb

line 22

old code worked:

"Create#{class_name}Hierarchies".gsub('::', '')

new code does not work:

"Create#{ct.hierarchy_class_name}".gsub(/\W/, '')

does not work

richkuo avatar Oct 08 '14 17:10 richkuo

Weird! I thought i did it correctly.

seuros avatar Oct 08 '14 17:10 seuros

Oh the code was altered! cc @mceachen

seuros avatar Oct 08 '14 17:10 seuros

Renaming the migration class name manually from CreateTagHierarchy to CreateTagHierarchies seems to work (as a workaround, until fixed).

rcanand avatar Oct 11 '14 11:10 rcanand