From ae30d11a1e90736de68e7ce73e8ef64c88fea1bb Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Wed, 1 May 2019 18:09:37 -0400 Subject: [PATCH] Save unsaved changes before locking Fixes a deprecation in rails 5.1: DEPRECATION WARNING: Locking a record with unpersisted changes is deprecated and will raise an exception in Rails 5.2. Use `save` to persist the changes, or `reload` to discard them explicitly. (called from update_options at ../app/models/service_template_transformation_plan_task.rb:190) --- app/models/service_template_transformation_plan_task.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/service_template_transformation_plan_task.rb b/app/models/service_template_transformation_plan_task.rb index aa5bd26c4a7..0a8dd60cc2c 100644 --- a/app/models/service_template_transformation_plan_task.rb +++ b/app/models/service_template_transformation_plan_task.rb @@ -187,6 +187,7 @@ def conversion_options end def update_options(opts) + save if changed? with_lock do # Automate is updating this options hash (various keys) as well, using with_lock. options.merge!(opts)