From 656d412546cd97d5660c634c2a41c799d3f9e211 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 6 Nov 2013 20:33:46 -0800 Subject: only ask for these ivars if the target responds to them --- railties/lib/rails/generators/app_base.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index ecf3551f50..40145a7a50 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -144,9 +144,9 @@ module Rails def initialize(target) @target = target # unfortunately, instance eval has access to these ivars - @app_const = target.send :app_const - @app_const_base = target.send :app_const_base - @app_name = target.send :app_name + @app_const = target.send :app_const if target.respond_to?(:app_const, true) + @app_const_base = target.send :app_const_base if target.respond_to?(:app_const_base, true) + @app_name = target.send :app_name if target.respond_to?(:app_name, true) @commands = [] @gems = [] end -- cgit v1.2.3