-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating rules for the fields with default values #537
Conversation
PR Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Please add a line for changelog. Thanks.
The line has been added to the changelog. Thanks. |
Thank you! |
This may sound unimportant, but if you are using yii\behaviors\AttributeTypecastBehavior and the cast depends on the rules() method of your model, for example, fields validated via yii\validators\NumberValidator and without any value will be cast to integer/float. So the value of the empty fields will become 0
An important part is that default rules should be at the beginning of the rule list.