lib/rubocop/cop/rails/file_path.rb in rubocop-0.48.0 vs lib/rubocop/cop/rails/file_path.rb in rubocop-0.48.1
- old
+ new
@@ -49,12 +49,16 @@
end
def check_for_rails_root_join_with_slash_separated_path(node)
return unless rails_root_nodes?(node)
return unless rails_root_join_nodes?(node)
- return unless node.method_args.any? { |arg| arg.source =~ %r{/} }
+ return unless node.method_args.any? { |arg| string_with_slash?(arg) }
register_offense(node)
+ end
+
+ def string_with_slash?(node)
+ node.type == :str && node.source =~ %r{/}
end
def register_offense(node)
line_range = node.loc.column...node.loc.last_column