aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/generators/components
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/generators/components')
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb5
1 files changed, 3 insertions, 2 deletions
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 7c46869f5e..5ffe428fce 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
@@ -67,6 +67,9 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
m.directory File.join('app/views', controller_class_path, controller_file_name)
m.directory File.join('test/functional', controller_class_path)
+ # Depend on model generator but skip if the model exists.
+ m.dependency 'model', [singular_name], :collision => :skip
+
# Scaffolded forms.
m.complex_template "form.rhtml",
File.join('app/views',
@@ -79,8 +82,6 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
:end_mark => 'eoform',
:mark_id => singular_name
- # Depend on model generator but skip if the model exists.
- m.dependency 'model', [singular_name], :collision => :skip
# Scaffolded views.
scaffold_views.each do |action|