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

New cop to check for 3-state booleans #337

Closed
fatkodima opened this issue Aug 23, 2020 · 4 comments · Fixed by #676
Closed

New cop to check for 3-state booleans #337

fatkodima opened this issue Aug 23, 2020 · 4 comments · Fixed by #676
Labels
feature request Request for new functionality

Comments

@fatkodima
Copy link
Contributor

https://thoughtbot.com/blog/avoid-the-threestate-boolean-problem

@koic
Copy link
Member

koic commented Aug 28, 2020

This style looks good to me. Can you open a PR to the Rails Style Guide, first?
https://github.com/rubocop-hq/rails-style-guide/pulls

For implementation, it is necessary to consider a applied migration files.

@silva96
Copy link

silva96 commented Sep 1, 2020

using a default value in a large table will cause a complete rewrite.

https://github.com/ankane/strong_migrations#adding-a-column-with-a-default-value

In Postgres 11+, MySQL 8.0.12+, and MariaDB 10.3.2+, this no longer requires a table rewrite and is safe.

@tejasbubane
Copy link
Contributor

tejasbubane commented Nov 24, 2020

For implementation, it is necessary to consider a applied migration files.

@koic We can only check schema.rb file and find offenses right?

@pirj
Copy link
Member

pirj commented Nov 24, 2020

Some use structure.sql. Also, schema.rb is not necessarily committed, even if exists on developer machines it might not be present on CI unless you run migrations before rubocop which would be a pretty weird requirement.

Checking migrations is the only way I can think of.

@koic koic added the feature request Request for new functionality label Mar 31, 2023
@koic koic closed this as completed in #676 Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants