Can globalize3 be added to the outer class of an ActiveRecord model?

I have a project for which I am using the globalize3 gem to allow multiple languages. In my own models, I just add 'translates field1, field2, etc.' and corresponding migrations, and everything works fine.

The problem is that I also have some features that depend on external gems. For some of these models, I would also like to add globalization. I do not have code for models to change directly, as it was with others. Reopening the model does not seem to work. Is there any way to add that translates the string into models that I don't have direct access to?

I use Rails 3.1 and Ruby 1.9.2, if that matters.

+4
source share
1 answer

Could you indicate the name of the gemstone and the model of this gemstone?

Are classes names below the module? If so, you cannot open classes correctly. I use qwandry stone to study the gems that I included in my project, so this can be useful in determining this. Of course, viewing the source on the project website is also good if it is available.

I assume that what happens when you say that it does not work is that the I18n.locale parameter does not affect the setting / getting of the fields, right? He would probably complain that there would be no table if it works, but you haven't created the table yet.

0
source

Source: https://habr.com/ru/post/1383903/


All Articles