1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Yuji Yaginuma 2016-12-10 09:21:28 +09:00 committed by David Heinemeier Hansson
parent ecddc0468d
commit c16296c795

View file

@ -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