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

3-state boolean columns emphasis on NOT NULL constraint #363

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

armandmgt
Copy link

@armandmgt armandmgt commented Jan 14, 2025

As discussed in #343, the problem of 3-state boolean columns comes from the nullability of the column.

This PR adds emphasis on this. Default values are only required when adding a column to an existing table so create_table :users { |t| t.boolean :active, null: false } is completely valid.

fixes #343

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Minor notes below.

@pirj pirj requested a review from a team January 14, 2025 15:43
@armandmgt
Copy link
Author

Hello @koic ! Would you have some time to review this so that we can follow up with the modification of the rubocop cop ?

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.

Suggestion: 3-state booleans don't require a default
2 participants