P
P
PaulTes2016-07-20 13:21:29
Ruby on Rails
PaulTes, 2016-07-20 13:21:29

How to implement localization of Rails + Sequel models?

Hello, I need to implement the localization of data models so that they do not generate additional queries to the database (PostgresSql). Using set_dataset does not lead to anything good. I lose the ability to save data. Since Sequel throws an error:

Sequel::DatabaseError: PG::SyntaxError: ERROR: syntax error at or near ","
LINE 1: INSERT INTO "user_roles", "loc_user_roles" ("name_key", "tes...

What do you advise?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arthur, 2016-07-28
@TheSunwave

If I understand correctly, then the easiest way to localize a model is to add a field with a locale to the model. And already, depending on the locale of the environment, make a regular query in the database, and show what corresponds to the locale.

A
Anton Davydov, 2016-07-28
@Fikys

Hey, try looking for the answer here , I hope it helps

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question