-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Change flag column check to be opt-in #52
Comments
@mouazq the flag column check can be turned off, even by a command line ENV param if you like:
|
hey pboling. But why checking the database column should be enabled by default if it's going to lead to this behaviour ? and would turning off the checker notify you too if somone missed to add the flag field to the db table ? Thanks for the reply. |
Perhaps it should be opt-in. It was added many years ago, and my understanding of best practice has evolved considerably since then. This gem needs an overhaul!
I think it will not warn you if turned off, but your project won't work, obviously, if the column is missing (aside from migrations). You can test it out if you like. |
I am going to re-open this as an issue to change the flag column check to opt-in. |
Would it not be possible to maintain the functionality at least as a callback that occurs once ActiveRecord is being used? The main problem as I can see it is that this code executes in the class context, as models are being loaded and defined, well before usual initialisation steps. As such this breaks commands like I get that flipping defaults etc is difficult (especially in SemVer) but |
I am sure there is a way to get this check hooked in at an appropriate point during initialization. I just haven't had time to look into it. It can/should probably be done with a Railtie? |
Let's say I have a flag in
User
model. When runningrake db:migrate
orrake db:setup
for the first time.You'll get this error and migration
Also
rake db:seed
after that would fail !!Even running test using
rspec
cause sometimes the same result !The text was updated successfully, but these errors were encountered: