diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-02 08:45:03 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-02 08:45:33 +0200 |
commit | afc102698672cdf546a15424471d3287a39dbb06 (patch) | |
tree | cdbd7d2722f3dc38830db3b0e97c0a57bb90aef9 /railties/guides/source/generators.textile | |
parent | fdd203f964e31fd81a16be8f68462a64a17b0d92 (diff) | |
download | rails-afc102698672cdf546a15424471d3287a39dbb06.tar.gz rails-afc102698672cdf546a15424471d3287a39dbb06.tar.bz2 rails-afc102698672cdf546a15424471d3287a39dbb06.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.textile | 12 |
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 |