Bring back removal of translatable columns #3828
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Objectives
Notes
Globalize does not support having translatable columns with the same name in the original table and the translations table. We were planning to migrate to Mobility, but we aren't doing so before releasing version 1.1.
We've also found a gotcha regarding having both columns: if we use the
update_column
method, which we use in rake tasks to speed up the process and in tests where we want to skip validations and callbacks, we update the column in the original table and no exception is raised. If we remove the column in the original table, when we useupdate_column
we get an exception, which is what we want since our intention is to update the column in the translations table.There are also fields we've added to translation tables but not the original tables, like
milestones_summary
andhomepage
inlegislation_process_translations
ordescription
inactive_polls
. Having some fields in both tables and some fields only in translation tables is not very consistent.With this change we're following the advice given by the Mobility lead developer: "If you don't need the columns, I think it would make sense to just remove them to avoid any edge case issues."