I am trying to update a model that has translated content through globalize3. To do so, I need to change the locale multiple times to update the model. However, the update_attributes method does not seem to accept a block as a parameter. Is there any other way that achieves the following?
Country.where(code: 'NLD').first_or_create.update_attributes do |country|
I18n.locale = :en
nld.name = 'Netherlands, The'
I18n.locale = :nl
nld.name = 'Nederland'
end
The reason that I am doing first_or_create followed by an update_attributes is that I want to be able to run my seed file multiple times and have the data updated accordingly.
G3 has
set_translationsmethod, so you can