From 5f00592466bd91107ecdfd055140cb2b36e29f50 Mon Sep 17 00:00:00 2001 From: Stefan Sprenger Date: Fri, 27 May 2011 13:25:35 +0200 Subject: [PATCH] Refactor identifying generator's destination root --- railties/lib/rails/commands/generate.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb index 1f742f885302d..1fb2d98834eae 100644 --- a/railties/lib/rails/commands/generate.rb +++ b/railties/lib/rails/commands/generate.rb @@ -8,8 +8,5 @@ name = ARGV.shift -if defined?(ENGINE_ROOT) - Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => ENGINE_ROOT -else - Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => Rails.root -end +root = defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root +Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => root