Skip to content

Conversation

@SaschaKoth
Copy link

If a date value is an empty string (''), the typecast should return null because e.g. pgsql dismiss empty strings. Swapping the if statements does this.

Please review!

Thanks
Sascha

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 939c46d on SaschaKoth:master into 64862f9 on yiisoft:master.

@cebe
Copy link
Member

cebe commented Nov 20, 2013

I remember we rejected similar request as it is magic and not necessarily wanted.
If you have empty string set to ActiveRecord for example you should use default value filter in validation rules to set it to null explicitly.

@qiangxue
Copy link
Member

Related: yiisoft/yii#2056

@YanAlex
Copy link

YanAlex commented Sep 19, 2022

2022 is NOW!

[['time_start', 'time_end'], 'default', 'value' => null],
Still write to MYSQL 00:00:00 instead of NULL.

FIX THIS ALREADY!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants