ruby-on-railsactiverecordglobalize

How to remove locale in globalize?


I'm using globalize/globalize to add model translations.
I have ru, en locales and want to remove en locale from object, how can I remove?

Tried to remove in such a way, but it removes all object with ru, en locales.

Country.with_translations(:en).find(1).destroy

Solution

  • Try this:

    country.translations.find_by(locale: :en).destroy