From 324380743f83f920d40e864d74984d579b8a44fd Mon Sep 17 00:00:00 2001 From: khiav reoy Date: Sat, 19 Aug 2023 19:05:45 +0800 Subject: [PATCH] Fix: ArgumentError: wrong number of arguments --- lib/atomically/query_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/atomically/query_service.rb b/lib/atomically/query_service.rb index 972a751..e0cceb4 100644 --- a/lib/atomically/query_service.rb +++ b/lib/atomically/query_service.rb @@ -51,7 +51,8 @@ def update_all(expected_size, *args) where_all_can_be_updated(@relation, expected_size).update_all(*args) end - def update(attrs, from: :not_set) + def update(attrs, options = {}) + from = options[:from] || :not_set success = update_and_return_number_of_updated_rows(attrs, from) == 1 if success