bellycard / napa

A simple framework for building APIs with Grape
Other
329 stars 72 forks source link

use camelize as to not singularize migrations ending in plurals #76

Closed kylecrum closed 10 years ago

kylecrum commented 10 years ago

using classify will singlularize migrations that end in plurals, which then raise a constant not defined error when trying to run the migration. e.g.

napa generate migration foo_bars

generates

class FooBar < ActiveRecord::Migration

when we really want

class FooBars < ActiveRecord::Migration
jdoconnor commented 10 years ago

+1

darbyfrey commented 10 years ago

@kylecrum Thanks for fixing this! This bug has been annoying me for awhile...

It looks like there is a bug in your spec, the rm_rf is failing. Looks like dirname is nil. This should fix it:

after do
  FileUtils.rm_rf(test_migrations_directory)
end

What do you think about changing migrations_directory to something like output_directory in the MigrationGenerator? If it was a little more generic we could use the common naming to follow the same pattern for testing in the other generators as well.

kylecrum commented 10 years ago

@darbyfrey , cool. Method changed and spec updated. Travis should pass now as well.

darbyfrey commented 10 years ago

@kylecrum great!

Thanks again for the contribution!