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

Fix for nil user.language_id Bug #969

Open
wants to merge 1 commit into
base: integration
Choose a base branch
from

Conversation

aaronskiba
Copy link
Collaborator

@aaronskiba aaronskiba commented Dec 19, 2024

NOTE: By default, migrations are auto-applied within production. However, the rake task needs be executed prior to the migration for the intended user.language_id updates to be applied.

Fixes #154

Changes proposed in this PR:

  • This commit seeks to resolve issue Language must exist warning when saving user privilege #154 via a rake task, followed by a migration:

    1) rake task

    • Updates user.language_id for all users where user.language_id == nil and user.org.language_id != nil (user.org.language_id != nil should be true for all users)
    • Updates user.language_id to user.org.language_id for each of the aforementioned users.

    2) migration

    • Adds the NOT NULL constraint to the language_id column of the users table.
    • Updates user.language_id to Language.default.id for any remaining nil user.language_id values (although, there shouldn't be any).

This commit seeks to resolve issue #154 via a rake task, followed by a migration:

1) rake task
 -  Updates `user.language_id` for all users where `user.language_id == nil` and `user.org.language_id != nil` (`user.org.language_id != nil` should be true for all users)
 - Updates `user.language_id to `user.org.language_id` for each user.

 2) migration
 - Adds the NOT NULL constraint to the `language_id` column of the `users` table.
 - Updates `user.language_id` to `Language.default.id` for any remaining nil `user.language_id` values (although, there shouldn't be any).
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.

1 participant