diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 21:20:29 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 21:20:29 +0000 |
commit | f6786f8dccc6f6ca91a08c3cbfa80625f9c6c993 (patch) | |
tree | aa63e878fe57882fc42577430f6218fd10614f8e /railties | |
parent | 74f02246ca60565dc1dd9a31e2b795718ef61359 (diff) | |
download | rails-f6786f8dccc6f6ca91a08c3cbfa80625f9c6c993.tar.gz rails-f6786f8dccc6f6ca91a08c3cbfa80625f9c6c993.tar.bz2 rails-f6786f8dccc6f6ca91a08c3cbfa80625f9c6c993.zip |
Make generation of namespaced models produce proper migrations #4219 [Caio Chassot]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3947 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails_generator/generators/components/model/model_generator.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/components/model/model_generator.rb b/railties/lib/rails_generator/generators/components/model/model_generator.rb index bd73f5bcdd..0940b57f73 100644 --- a/railties/lib/rails_generator/generators/components/model/model_generator.rb +++ b/railties/lib/rails_generator/generators/components/model/model_generator.rb @@ -18,8 +18,8 @@ class ModelGenerator < Rails::Generator::NamedBase unless options[:skip_migration] m.migration_template 'migration.rb', 'db/migrate', :assigns => { - :migration_name => "Create#{class_name.pluralize}" - }, :migration_file_name => "create_#{file_name.pluralize}" + :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}" + }, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}" end end end |