aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-06-02 08:45:03 +0200
committerJosé Valim <jose.valim@gmail.com>2010-06-02 08:45:33 +0200
commitafc102698672cdf546a15424471d3287a39dbb06 (patch)
treecdbd7d2722f3dc38830db3b0e97c0a57bb90aef9 /railties/lib/rails
parentfdd203f964e31fd81a16be8f68462a64a17b0d92 (diff)
downloadrails-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/lib/rails')
-rw-r--r--railties/lib/rails/commands/destroy.rb1
-rwxr-xr-xrailties/lib/rails/commands/generate.rb1
-rw-r--r--railties/lib/rails/generators.rb8
3 files changed, 4 insertions, 6 deletions
diff --git a/railties/lib/rails/commands/destroy.rb b/railties/lib/rails/commands/destroy.rb
index 9023c61bf2..db59cd8ad9 100644
--- a/railties/lib/rails/commands/destroy.rb
+++ b/railties/lib/rails/commands/destroy.rb
@@ -1,4 +1,5 @@
require 'rails/generators'
+Rails::Generators.configure!
if [nil, "-h", "--help"].include?(ARGV.first)
Rails::Generators.help 'destroy'
diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb
index 7d05a30de8..1b3eef504a 100755
--- a/railties/lib/rails/commands/generate.rb
+++ b/railties/lib/rails/commands/generate.rb
@@ -1,4 +1,5 @@
require 'rails/generators'
+Rails::Generators.configure!
if [nil, "-h", "--help"].include?(ARGV.first)
Rails::Generators.help 'generate'
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index fe8a6c0b94..af92757053 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -68,6 +68,7 @@ module Rails
options.deep_merge! config.options
fallbacks.merge! config.fallbacks
templates_path.concat config.templates
+ templates_path.uniq!
end
def self.templates_path
@@ -328,10 +329,5 @@ module Rails
paths.uniq!
paths
end
-
end
-end
-
-# If the application was already defined, configure generators,
-# otherwise you have to configure it by hand.
-Rails::Generators.configure! if Rails.respond_to?(:application) && Rails.application
+end \ No newline at end of file