A developer should be able to customize the template used by the model or migration generator, by adding a file to their source tree in a predictable location.
This functionality was likely broken by:
After that change, you could now generate a migration:
`rails g migration CreateFoo`
and it would look for a custom template at `myproject/lib/templates/active_record/migration/create_table_migration.rb`
However, if you generated the migration by generating a model:
`rails g model Bar`
it would look for a template at the unpredictable and awkward path `myproject/lib/templates/migration/templates/create_table_migration.rb`
This Pull Request adds the migration generator's template paths to the model generator's search paths. When you generate a model, it will now look for templates in order:
This has the side-effect of allowing you to have different templates for creating a table, depending on whether you generated a model or the migration directly.