lib/synvert/snippets/rails/strong_parameters.rb in synvert-0.0.6 vs lib/synvert/snippets/rails/strong_parameters.rb in synvert-0.0.7
- old
+ new
@@ -1,8 +1,15 @@
-Synvert::Rewriter.new "strong_parameters", "use strong_parameters syntax" do
+Synvert::Rewriter.new "strong_parameters", "Use strong_parameters syntax" do
within_files 'config/**/*.rb' do
# remove config.active_record.whitelist_attributes = ...
with_node type: 'send', receiver: {type: 'send', receiver: {type: 'send', message: 'config'}, message: 'active_record'}, message: 'whitelist_attributes=' do
+ remove
+ end
+ end
+
+ within_files 'config/**/*.rb' do
+ # remove config.active_record.mass_assignment_sanitizer = ...
+ with_node type: 'send', receiver: {type: 'send', receiver: {type: 'send', message: 'config'}, message: 'active_record'}, message: 'mass_assignment_sanitizer=' do
remove
end
end
parameters = {}