Using the mobility
gem for i18n, the process of importing data from CSV for jsonb
data is not succeeding.
Whereas, one generally imports
Class.create(
name_en: row[2],
name_fr: row[3],
[...]
for the local-driven values in a key_value backend, with a postgresql backend the column has to be populated with hash, with the key and value.
However, the syntax is incorrect
name: { 'en' = row[2], 'fr' = row[2]}
leads to error
syntax error, unexpected '=', expecting '.' or &. or :: or '['
and name: { 'en': row[2], 'fr': row[2]}
seems syntaxtically correct, but yields
Error importing row because 'No plugin configured for these keys: type.'
note this occurs with any of the following definitions in config/initializers/mobility.rb`
backend :jsonb
backend :jsonb, type: :json
backend :jsonb, type: :string