app/models/setting.rb
# makes sure at least one of the chosen locales is an available locale
makes sure at least one of the chosen locales is an available locale
makes sure at least one of the chosen locales is an available locale
def one_locale_must_have_translations
    return unless (preferred_locales & I18n.available_locales).empty?
    errors.add(:preferred_locales_str, :one_must_have_translations,
      locales: I18n.available_locales.join(","))
  end
def one_locale_must_have_translations return unless ( preferred_locales & I18n . available_locales ) . empty? errors . add ( :preferred_locales_str , :one_must_have_translations , locales : I18n . available_locales . join ( "," ) ) end
makes sure at least one of the chosen locales is an available locale
makes sure at least one of the chosen locales is an available locale