Skip to content

Commit

Permalink
FIX #159 use str#dump and sym#inspect over string interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
ngouy committed Dec 3, 2019
1 parent b7956e6 commit 80857ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rails/enum_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def enum_name(key)
def source(elem)
case elem.type
when :str
"\"#{elem.value}\""
elem.value.dump
when :sym
elem.source.include?(':') ? elem.source : ":#{elem.value}"
elem.value.inspect
else
elem.source
end
Expand Down

0 comments on commit 80857ed

Please sign in to comment.