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

[Backport] Migrate globalize data #2986

Merged
merged 7 commits into from
Oct 26, 2018
Merged

Commits on Oct 23, 2018

  1. Add task to migrate data to translation tables

    We forgot to do it when we created the translation tables, and so now we
    need to make sure we don't overwrite existing translations.
    javierm committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    ef7be4f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a84a0f2 View commit details
    Browse the repository at this point in the history
  3. Use migrate_data option for globalize

    This way the task to migrate the data doesn't have to be run manually if
    these migrations weren't already executed.
    javierm committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    be25e5f View commit details
    Browse the repository at this point in the history
  4. Log failed data migrations

    In theory, it should never happen, but that's why exceptions exist.
    javierm committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    3c48059 View commit details
    Browse the repository at this point in the history
  5. Add task to simulate data migration

    This way we can check everything is OK before actually migrating the
    data to the translations tables.
    javierm committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    7fff57a View commit details
    Browse the repository at this point in the history
  6. Don't abort the migration if the simulation fails

    We think aborting the migration will generate more headaches to system
    administrators, who will have to manually check and fix every invalid
    record before anything can be migrated.
    javierm committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    934bce5 View commit details
    Browse the repository at this point in the history
  7. Fix bug with non-underscored locales

    Ruby can't have hyphens in method names, so sending something like
    `record.title_pt-BR` would raise an exception.
    
    Using globalize's `localized_attr_name_for` method fixes the bug.
    
    Thanks Marko for the tip.
    javierm committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    9404cb8 View commit details
    Browse the repository at this point in the history