rubocop-rails
rubocop-rails copied to clipboard
New cop to check for 3-state booleans
https://thoughtbot.com/blog/avoid-the-threestate-boolean-problem
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.
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.
For implementation, it is necessary to consider a applied migration files.
@koic We can only check schema.rb
file and find offenses right?
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.