- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
In the model User you have the code shown below. When saving the model and model.is_admin is set to true, which callback will be called?before_save :encrypt_data, unless: ->(model) { model.is_admin }after_save :clear_cache, if: ->(model) { model.is_admin }before_destroy :notify_admin_users, if: ->(model) { model.is_admin }

1. encrypt_data

2.clear_cache

3. notify_admin_users

4.None of these callbacks will be called when is_admin is true.

Posted Date:-2022-09-17 04:12:51


More MCQS Questions and answers

Search