Permalink
Browse files

Fix script/generate. Part II

  • Loading branch information...
distler committed Jul 11, 2017
1 parent 3cd06aa commit e9afd4b4b24609c1f494ce01dc0bc799355e9591
Showing with 3 additions and 1 deletion.
  1. +3 −1 vendor/rails/railties/lib/rails_generator/commands.rb
@@ -299,7 +299,9 @@ def template(relative_source, relative_destination, template_options = {})
# Evaluate any assignments in a temporary, throwaway binding.
vars = template_options[:assigns] || {}
b = template_options[:binding] || binding
vars.each { |k,v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b }
#vars.each { |k,v| eval"#{k} = vars[:#{k}] || vars['#{k}']", b }
vars.each { |k,v| eval("#{k} = '#{v}'", b) }
eval("attributes ||= {}", b)
# Render the source file with the temporary binding.
ERB.new(file.read, nil, '-').result(b)

0 comments on commit e9afd4b

Please sign in to comment.