You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roni Helminen edited this page Jan 9, 2022
·
10 revisions
The container backend is a new backend available as of version 0.4.x, which stores all translations for a model on a single json/jsonb column, defaulting to the translations column. See this PR and this blog post for background.
To use this backends, you will need to first add a column (named translations) to each translated model.
(As of Mobility 0.5, this column can also alternatively be a json column, with mostly the same behavior.)
Once the migration is created, make sure to change the actual migration to set the default value of the column(s) to an empty jsonb object ({}), so it looks like this:
Translated attributes title and content are now available. Mobility will now save the values of title and content in a depth-2 hash where the first level keys are locales.
Since translations are now stored in just a single database column, you can see the translations for both attributes by simply accessing the translations column: