Додати до Chrome
✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
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.
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!