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