diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-16 22:56:40 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-16 22:56:40 +0000 |
commit | ace7518fcb3d592f63d599f299699c653980c396 (patch) | |
tree | 74ef4c50442e9261ab80c22db661c946e875a762 | |
parent | 473202df83690d1b6ab08e6166a483109f8c769f (diff) | |
download | rails-ace7518fcb3d592f63d599f299699c653980c396.tar.gz rails-ace7518fcb3d592f63d599f299699c653980c396.tar.bz2 rails-ace7518fcb3d592f63d599f299699c653980c396.zip |
Resource and scaffold generators pass on the full name to the dependent model, so nested resources give a corresponding nested model.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/lib/rails_generator/generators/components/resource/resource_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/components/resource/resource_generator.rb b/railties/lib/rails_generator/generators/components/resource/resource_generator.rb index 669f4ff904..d5491ece36 100644 --- a/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +++ b/railties/lib/rails_generator/generators/components/resource/resource_generator.rb @@ -41,7 +41,7 @@ class ResourceGenerator < Rails::Generator::NamedBase m.directory(File.join('test/functional', controller_class_path)) m.directory(File.join('test/unit', class_path)) - m.dependency 'model', [singular_name] + @args, :collision => :skip + m.dependency 'model', [name] + @args, :collision => :skip m.template( 'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb") diff --git a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb index d9ce668f2e..c9ce49a6fc 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +++ b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb @@ -54,7 +54,7 @@ class ScaffoldGenerator < Rails::Generator::NamedBase m.template('layout.html.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.erb")) m.template('style.css', 'public/stylesheets/scaffold.css') - m.dependency 'model', [singular_name] + @args, :collision => :skip + m.dependency 'model', [name] + @args, :collision => :skip m.template( 'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb") |