aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/generators.textile
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-06-02 08:45:03 +0200
committerMikel Lindsaar <raasdnil@gmail.com>2010-06-03 23:32:12 +1000
commit44cb6dce62a75b259a9e00aed1ff0aa1eb369c9b (patch)
treef756a6401ba88013e3726f19dcb0f43ab91ba0b3 /railties/guides/source/generators.textile
parenta73d6e7913bdc2d4de8c63b7cc4095f0241d761e (diff)
downloadrails-44cb6dce62a75b259a9e00aed1ff0aa1eb369c9b.tar.gz
rails-44cb6dce62a75b259a9e00aed1ff0aa1eb369c9b.tar.bz2
rails-44cb6dce62a75b259a9e00aed1ff0aa1eb369c9b.zip
Still copy application configuration to generator even if they are required earlier. Also tidy up the guide a little bit.
Diffstat (limited to 'railties/guides/source/generators.textile')
-rw-r--r--railties/guides/source/generators.textile12
1 files changed, 4 insertions, 8 deletions
diff --git a/railties/guides/source/generators.textile b/railties/guides/source/generators.textile
index d3757e9733..b77a2837c3 100644
--- a/railties/guides/source/generators.textile
+++ b/railties/guides/source/generators.textile
@@ -322,14 +322,10 @@ config.generators do |g|
g.template_engine :erb
g.test_framework :shoulda, :fixture => false
g.stylesheets false
-end
-</ruby>
-
-And at the end of the same file:
-<ruby>
-require 'rails/generators'
-Rails::Generators.fallbacks[:shoulda] = :test_unit
+ # Add a fallback!
+ g.fallbacks[:should] = :test_unit
+end
</ruby>
Now, if create a Comment scaffold, you will see that shoulda generators are being invoked, and at the end, they are just falling back to test unit generators:
@@ -361,7 +357,7 @@ $ rails generate scaffold Comment body:text
create test/unit/helpers/comments_helper_test.rb
</shell>
-Such tool allows your generators to have single responsibility, increasing the code reuse and reducing the amount of code duplication.
+Such tool allows your generators to have single responsibility, increasing the code reuse and reducing the amount of duplication.
h3. Changelog