aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-11-06 20:33:46 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2013-11-06 20:34:04 -0800
commit656d412546cd97d5660c634c2a41c799d3f9e211 (patch)
treecbbbd1f3da52486d0852425ce6e17ed9b3b08fe5
parent9348fb6b1746aa0fed122e8f60b759025e242e2b (diff)
downloadrails-656d412546cd97d5660c634c2a41c799d3f9e211.tar.gz
rails-656d412546cd97d5660c634c2a41c799d3f9e211.tar.bz2
rails-656d412546cd97d5660c634c2a41c799d3f9e211.zip
only ask for these ivars if the target responds to them
-rw-r--r--railties/lib/rails/generators/app_base.rb6
1 files 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