From b9fcce3944653db5eb49119c134e8525e91f7aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 17 Oct 2014 15:52:32 -0300 Subject: Merge pull request #17302 from claudiob/replace-slower-block-call-with-faster-yield Replace (slower) block.call with (faster) yield --- railties/lib/rails/generators/actions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails/generators/actions.rb') diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index b2c9d12996..ffdb314612 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -85,10 +85,10 @@ module Rails # environment(nil, env: "development") do # "config.autoload_paths += %W(#{config.root}/extras)" # end - def environment(data=nil, options={}, &block) + def environment(data=nil, options={}) sentinel = /class [a-z_:]+ < Rails::Application/i env_file_sentinel = /Rails\.application\.configure do/ - data = block.call if !data && block_given? + data = yield if !data && block_given? in_root do if options[:env].nil? -- cgit v1.2.3