Skip to content

Commit

Permalink
Save unsaved changes before locking
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jrafanie committed May 1, 2019
1 parent 8f78463 commit ae30d11
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/service_template_transformation_plan_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae30d11

Please sign in to comment.