Re-add delete_all and destroy_all methods

These methods don't take any arguments in Rails versions > 3, but
there's no harm in checking for them anyway, and some people might be
using very old Rails versions.
This commit is contained in:
Harry Maclean
2021-09-30 09:35:01 +01:00
parent 75bbc51e73
commit 7191e1c007
3 changed files with 20 additions and 12 deletions

View File

@@ -68,10 +68,10 @@ private Expr sqlFragmentArgument(MethodCall call) {
(
methodName =
[
"delete_by", "destroy_by", "exists?", "find_by", "find_by!", "find_or_create_by",
"find_or_create_by!", "find_or_initialize_by", "find_by_sql", "from", "group", "having",
"joins", "lock", "not", "order", "pluck", "where", "rewhere", "select", "reselect",
"update_all"
"delete_all", "delete_by", "destroy_all", "destroy_by", "exists?", "find_by", "find_by!",
"find_or_create_by", "find_or_create_by!", "find_or_initialize_by", "find_by_sql", "from",
"group", "having", "joins", "lock", "not", "order", "pluck", "where", "rewhere", "select",
"reselect", "update_all"
] and
result = call.getArgument(0)
or