app/models/setting.rb
# makes sure all language codes are valid ISO639 codes
makes sure all language codes are valid ISO639 codes
makes sure all language codes are valid ISO639 codes
def locales_are_valid
    preferred_locales.each do |l|
      errors.add(:preferred_locales_str, :invalid_code, code: l) unless ISO_639.find(l.to_s)
    end
  end
def locales_are_valid preferred_locales . each do | l | errors . add ( :preferred_locales_str , :invalid_code , code : l ) unless ISO_639 . find ( l . to_s ) end end
makes sure all language codes are valid ISO639 codes
makes sure all language codes are valid ISO639 codes