From 80857ed146bf6f877762ff06dd81ecb1451e92de Mon Sep 17 00:00:00 2001 From: Nathan Gouy Date: Tue, 3 Dec 2019 09:22:28 -0500 Subject: [PATCH] FIX #159 use str#dump and sym#inspect over string interpolation --- lib/rubocop/cop/rails/enum_hash.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rubocop/cop/rails/enum_hash.rb b/lib/rubocop/cop/rails/enum_hash.rb index 139458dd27..fa36006d5e 100644 --- a/lib/rubocop/cop/rails/enum_hash.rb +++ b/lib/rubocop/cop/rails/enum_hash.rb @@ -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