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

added migration check before setting default values. #2

Closed
wants to merge 1 commit into from

Conversation

@shicholas
Copy link

shicholas commented Mar 7, 2015

This may be bad practice, but I have worked with multiple rails apps where people create seed data in the migration files (e.g. an update_all column to update a static value). This check just ensures that the default values on a NullObject don't get set if there are current migrations, in other words #null_model does not set column defaults during db:migrate.

This may be bad practice, but I have worked with multiple rails apps where people create seed data in the migration files (e.g. an ``update_all`` column to update a static value). This check just ensures that the default values on a ``NullObject`` don't get set if there are current migrations, in other words ``#null_model`` does not set column defaults during ``db:migrate``.
Copy link
Owner

alexpeachey left a comment

I don't believe this change is necessary as the methods that are defined with defaults are on the null models. I would assume you are not trying to insert/update null models in your database in a migration.

@shicholas

This comment has been minimized.

Copy link
Author

shicholas commented Jan 21, 2020

Haha fair enough. Hope you’re doing well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.