Validation contexts are really useful, however only the methods
save allow you to pass a custom validation context. What about
If you want to pass a validation context when calling
update on an Active Record model instance, add this to your base class, which is
ApplicationRecord by default in Rails 4.x and 5.x.
1 2 3 4 5 6 7 8 9 10
Now you can call
mymodel.update_with_context(model_params, :my_special_context, and pass your custom validation context along.