diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-29 17:41:10 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-29 17:51:06 +0100 |
commit | 17ea8d8d4d81b4b9fb40bd6c6ee80f4acf3bad94 (patch) | |
tree | 535d13eba63a7b89395e1b7658a29b7234f10d7e /railties/lib/rails | |
parent | cc2642b220958894c5a384530f32f622f76cd097 (diff) | |
download | rails-17ea8d8d4d81b4b9fb40bd6c6ee80f4acf3bad94.tar.gz rails-17ea8d8d4d81b4b9fb40bd6c6ee80f4acf3bad94.tar.bz2 rails-17ea8d8d4d81b4b9fb40bd6c6ee80f4acf3bad94.zip |
Automatically configure generators if application is defined.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/commands/destroy.rb | 1 | ||||
-rwxr-xr-x | railties/lib/rails/commands/generate.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators.rb | 3 |
3 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/destroy.rb b/railties/lib/rails/commands/destroy.rb index a2eff377ce..92a06ebdd8 100644 --- a/railties/lib/rails/commands/destroy.rb +++ b/railties/lib/rails/commands/destroy.rb @@ -1,5 +1,4 @@ require 'rails/generators' -Rails::Generators.configure! if ARGV.size == 0 Rails::Generators.help diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb index c1120aad74..5e45d8ab46 100755 --- a/railties/lib/rails/commands/generate.rb +++ b/railties/lib/rails/commands/generate.rb @@ -1,5 +1,4 @@ require 'rails/generators' -Rails::Generators.configure! if ARGV.size == 0 Rails::Generators.help diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 1271de7af9..90b513fcb4 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -286,3 +286,6 @@ module Rails 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
\ No newline at end of file |