Skip to content

Commit

Permalink
only ask for these ivars if the target responds to them
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Nov 7, 2013
1 parent 9348fb6 commit 656d412
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions railties/lib/rails/generators/app_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ class TemplateRecorder < ::BasicObject # :nodoc:
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
Expand Down

0 comments on commit 656d412

Please sign in to comment.