discourse/app/models/locale_site_setting.rb
Sam ea932b74e7 values is a much more consistent name than all_values ... we use {}.values not {}.all_values
also fixes random ordering of tests failure in site settings
2013-06-23 15:07:49 +10:00

21 lines
381 B
Ruby

class LocaleSiteSetting
def self.valid_value?(val)
supported_locales.include?(val)
end
def self.values
supported_locales
end
private
@lock = Mutex.new
def self.supported_locales
@lock.synchronize do
@supported_locales ||= Dir.glob( File.join(Rails.root, 'config', 'locales', 'client.*.yml') ).map {|x| x.split('.')[-2]}.sort
end
end
end