Created
November 5, 2021 08:05
-
-
Save dvodvo/4af67f3015049d848889026c9c84a37c to your computer and use it in GitHub Desktop.
Mobility gem, migrating existing values to key-value table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assuming Mobility is already configured. if one wishes to properly synch up and migrate existing values from the class table attribute to the default locale | |
following example with attributes `description_short, description_long, description_search` and default_locale `de` | |
@articles.all each do |article| | |
article.update(description_short_de: article[:description_short], description_long_de: article[:description_long], description_search_de: article[:description_search]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment