diff --git a/lib/odbc_adapter/concerns/insert_attribute_stripper.rb b/lib/odbc_adapter/concerns/insert_attribute_stripper.rb index 0ace5dbb..35dce2a9 100644 --- a/lib/odbc_adapter/concerns/insert_attribute_stripper.rb +++ b/lib/odbc_adapter/concerns/insert_attribute_stripper.rb @@ -33,10 +33,12 @@ def save_internal(base_function, **options, &block) else stripped_attributes = {} end - base_function.call(**options, &block) + first_call_result = base_function.call(**options, &block) if stripped_attributes.any? restore_stripped_attributes(stripped_attributes) - base_function.call(**options, &block) + return base_function.call(**options, &block) + else + return first_call_result end end end