Skip to content

Commit 18ff328

Browse files
committed
Improve gem comment condition
1 parent f60fbfa commit 18ff328

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

railties/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,9 @@
104104

105105
*Gannon McGibbon*
106106

107+
* Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
108+
109+
*Linas Juškevičius*
110+
107111

108112
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md) for previous changes.

railties/lib/rails/generators/actions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def gem(*args)
4545

4646
in_root do
4747
str = []
48-
unless comment.nil?
48+
if comment
4949
comment.each_line do |comment_line|
5050
str << indentation
5151
str << "# #{comment_line}"

0 commit comments

Comments
 (0)