From c16d7df1d8d164536c38742e41d29258480c4edb Mon Sep 17 00:00:00 2001 From: Matt Gadda Date: Sat, 29 Nov 2008 00:05:50 -0700 Subject: [PATCH] Allow custom rails generators to pass in their own binding to Create command so that the corresponding erb templates get rendered with the proper binding --- railties/lib/rails_generator/commands.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb index 6b9a636..60a55f5 100644 --- a/railties/lib/rails_generator/commands.rb +++ b/railties/lib/rails_generator/commands.rb @@ -293,7 +293,7 @@ HELP file(relative_source, relative_destination, template_options) do |file| # Evaluate any assignments in a temporary, throwaway binding. vars = template_options[:assigns] || {} - b = binding + b = template_options[:binding] || binding vars.each { |k,v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b } # Render the source file with the temporary binding. -- 1.6.0.2