Skip to content

Commit 2be83e6

Browse files
committed
use PRISM_PARSER in rails/convert_configs_6_1_to_7_0
1 parent b70a53a commit 2be83e6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/rails/convert_configs_6_1_to_7_0.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# frozen_string_literal: true
22

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

66
description <<~EOS
77
It converts rails configs from 6.1 to 7.0
88
99
It sets `config.load_defaults 7.0` in config/application.rb.
10+
11+
It removes `config.autoloader = :classic` in config/application.rb.
1012
EOS
1113

1214
if_gem 'rails', '~> 7.0.0'
1315

1416
call_helper 'rails/set_load_defaults', rails_version: '7.0'
1517

1618
within_files 'config/application.rb' do
17-
find_node '.send[receiver=.send[receiver=nil][message=config][arguments.size=0]][message=autoloader=][arguments.size=1]' do
19+
with_node node_type: 'call_node',
20+
receiver: { node_type: 'call_node', name: 'config' },
21+
name: 'autoloader=',
22+
arguments: { node_type: 'arguments_node', arguments: { size: { gt: 0 } } } do
1823
remove
1924
end
2025
end

0 commit comments

Comments
 (0)