Skip to content
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

Empty string saved instead of NULL #475

Closed
Fabryz opened this issue Feb 4, 2014 · 1 comment
Closed

Empty string saved instead of NULL #475

Fabryz opened this issue Feb 4, 2014 · 1 comment
Labels

Comments

@Fabryz
Copy link

Fabryz commented Feb 4, 2014

I have a nullable string field on my model, when I save it from the backend while leaving the text field empty as default, it saves that value as an empty string instead of NULL.
How do I make it to save NULL?

@janhartigan
Copy link
Member

Use a mutator to check if it's an empty string and set it to null if it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants