aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorYuji Yaginuma <yuuji.yaginuma@gmail.com>2016-12-10 09:21:28 +0900
committerDavid Heinemeier Hansson <david@loudthinking.com>2016-12-09 16:21:28 -0800
commitc16296c79556ac660a0d7bd2df95e348a9e8df31 (patch)
treedfe31f94143cca9dac1b20d065a61f2f81bde73c /railties
parentecddc0468d6cacd06faaa474d11f96f41b17ac78 (diff)
downloadrails-c16296c79556ac660a0d7bd2df95e348a9e8df31.tar.gz
rails-c16296c79556ac660a0d7bd2df95e348a9e8df31.tar.bz2
rails-c16296c79556ac660a0d7bd2df95e348a9e8df31.zip
gemfile entry method need to return an empty array rather than nil (#27318)
This fixes the following error when executing rails new command. ``` (erb):9:in `block in template': undefined method `comment' for nil:NilClass (NoMethodError) ``` Follow up to #27288
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/app_base.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 187f4555a2..578aa23513 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -320,10 +320,10 @@ module Rails
end
def webpacker_gemfile_entry
- if options[:webpack]
- comment = "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker"
- GemfileEntry.github "webpacker", "rails/webpacker", nil, comment
- end
+ return [] unless options[:webpack]
+
+ comment = "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker"
+ GemfileEntry.github "webpacker", "rails/webpacker", nil, comment
end
def jbuilder_gemfile_entry