diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-25 01:16:32 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-25 01:16:50 +0200 |
commit | 594b749f3c81102a1f89480d0f8f10b464b895a7 (patch) | |
tree | 64be4f3726e5510e18c7f2632452bfb600d3597f /railties/lib/rails/commands.rb | |
parent | d1d34ce4990f6e9f1110d71ec5a9fd59dc5a6538 (diff) | |
download | rails-594b749f3c81102a1f89480d0f8f10b464b895a7.tar.gz rails-594b749f3c81102a1f89480d0f8f10b464b895a7.tar.bz2 rails-594b749f3c81102a1f89480d0f8f10b464b895a7.zip |
Streamline generators initialization flow.
Diffstat (limited to 'railties/lib/rails/commands.rb')
-rw-r--r-- | railties/lib/rails/commands.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index 4a082aedb8..39627a3094 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -15,6 +15,8 @@ command = aliases[command] || command case command when 'generate', 'destroy', 'plugin' + require 'rails/generators' + if command == 'plugin' && ARGV.first == 'new' require "rails/commands/plugin_new" else @@ -22,7 +24,9 @@ when 'generate', 'destroy', 'plugin' Rails.application.require_environment! if defined?(ENGINE_PATH) && engine = Rails::Engine.find(ENGINE_PATH) - Rails.application = engine + Rails.application.load_generators(engine) + else + Rails.application.load_generators end require "rails/commands/#{command}" |