Skip to content

Commit 7f6c9f5

Browse files
committed
use PRISM_PARSER in rails/remove_active_support_dependencies_private_api
1 parent c5d7a6f commit 7f6c9f5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/rails/remove_active_support_dependencies_private_api.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
Synvert::Rewriter.new 'rails', 'remove_active_support_dependencies_private_api' do
4-
configure(parser: Synvert::PARSER_PARSER)
4+
configure(parser: Synvert::PRISM_PARSER)
55

66
description <<~EOS
77
It removes active support dependencies private api.
@@ -22,8 +22,11 @@
2222
if_gem 'active_support', '>= 7.0'
2323

2424
within_files Synvert::ALL_RUBY_FILES + Synvert::ALL_RAKE_FILES do
25-
find_node '.send[receiver=ActiveSupport::Dependencies][message IN (constantize safe_constantize)][arguments.size=1][arguments.0="User"]' do
26-
replace_with '{{arguments.0}}.{{message}}'
25+
with_node node_type: 'call_node',
26+
receiver: 'ActiveSupport::Dependencies',
27+
name: { in: ['constantize', 'safe_constantize'] },
28+
arguments: { node_type: 'arguments_node', arguments: { size: 1 } } do
29+
replace_with '{{arguments.arguments.0}}.{{message}}'
2730
end
2831
end
2932
end

0 commit comments

Comments
 (0)