Skip to content

Commit 048ef56

Browse files
committed
Fix require_to_s usage on dstr cases
1 parent 92f433c commit 048ef56

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/rubocop/cop/rails/file_path.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def on_dstr(node)
6262
return unless last_child_source.start_with?('.') || last_child_source.include?(File::SEPARATOR)
6363
return if last_child_source.start_with?(':')
6464

65-
register_offense(node, require_to_s: true)
65+
register_offense(node, require_to_s: false)
6666
end
6767

6868
def on_send(node)
@@ -106,7 +106,6 @@ def string_with_slash?(node)
106106
def register_offense(node, require_to_s:)
107107
line_range = node.loc.column...node.loc.last_column
108108
source_range = source_range(processed_source.buffer, node.first_line, line_range)
109-
require_to_s = false if node.dstr_type?
110109

111110
message = build_message(require_to_s)
112111

0 commit comments

Comments
 (0)