We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b520acd commit 10874c0Copy full SHA for 10874c0
lib/factory_bot/use_string_as_class_name.rb
@@ -26,9 +26,8 @@
26
EOS
27
28
within_files Synvert::RAILS_FACTORY_FILES do
29
- find_node '.block[caller=.send[message=factory][arguments.size=2]] caller.arguments
30
- .hash:has(.pair[key=class][value=.const])' do
31
- replace 'class_value', with: wrap_with_quotes(node.class_source)
+ find_node '.block[caller=.send[message=factory][arguments.size=2][arguments.-1=.hash[class_value=.const]]]' do
+ replace 'caller.arguments.-1.class_value', with: wrap_with_quotes(node.caller.arguments.last.class_source)
32
end
33
34
0 commit comments