Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the purpose of the following code in the Product model, and what security vulnerability does it address?
The code sanitizes user input to prevent SQL injection attacks when querying the Product model.
The code validates the presence of the name attribute to prevent the creation of products without a name.
The code validates the numericality of the price attribute to ensure that only positive prices are allowed.
The code encrypts sensitive data in the Product model to protect against data leaks or breaches.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!