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

Make allowNull default for DS.attr('boolean') in 3.0 #4571

Closed
sandstrom opened this issue Oct 11, 2016 · 4 comments
Closed

Make allowNull default for DS.attr('boolean') in 3.0 #4571

sandstrom opened this issue Oct 11, 2016 · 4 comments

Comments

@sandstrom
Copy link
Contributor

sandstrom commented Oct 11, 2016

@pangratz made a great enhancement here: #4022

I would be happy with either of (1) removing the option (string and number transforms has no option) or (2) flip the default value of the option to true.

This would make this transform consistent with string, number etc. where no option is required to allow null. Since it's a breaking change we must wait until 3.0.

@sandstrom sandstrom changed the title Make allowNull default for DS.attr('boolean') in Ember Data 3.0 Make allowNull default for DS.attr('boolean') in 3.0 Oct 11, 2016
@aars
Copy link

aars commented Oct 12, 2016

Booleans in DB context are often misused, with people expecting NULL and False to equate, etc. IMHO the allowNull default should be false. Using ternary booleans should be a conscience decision by the developer.

@bmac
Copy link
Member

bmac commented Oct 14, 2016

I can understand the desire to have consistency around the default for allowNull however I'm concerned about the cost of switching the default will result in more pain then the benefits of increased consistency.

Right now we don't have a good way to switch default other then logging a warning in the 2.x version then switching in 3.0. Some of the feedback from the 2.x release with changing the defaults for async relationships was painful since you couldn't effectively address the change until you were on the next major release (unlike a deprecated method where you could replace a deprecated method with the new api before bumping the major version).

@sandstrom
Copy link
Contributor Author

sandstrom commented Oct 15, 2016

You could start logging in a 2.x version released at the same time as 3.0, that would present a clear path. Or simply skip logging and mention it as a breaking change in the 3.0 changelog.

This is a small change, after all. Async relationships affected basically all models, where as this will affect a smaller amount of models.

@rwjblue
Copy link
Member

rwjblue commented Feb 19, 2020

Sorry for letting this sit so long! I think in general, we want to be moving away from transforms conceptually (because they add complexity in general and could easily be replaced directly in the serializer itself).

Again, sorry for the delays, but I don't think we are going to move this direction so I'm going to go ahead and close this issue...

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

No branches or pull requests

6 participants