lib/tolk/sync.rb in tolk-1.3.6 vs lib/tolk/sync.rb in tolk-1.3.7
- old
+ new
@@ -15,10 +15,10 @@
filter_out_i18n_keys(translations.merge(read_primary_locale_file))
end
def read_primary_locale_file
primary_file = "#{self.locales_config_path}/#{self.primary_locale_name}.yml"
- File.exists?(primary_file) ? flat_hash(YAML::load(IO.read(primary_file))[self.primary_locale_name]) : {}
+ File.exists?(primary_file) ? flat_hash(YAML::safe_load(IO.read(primary_file))[self.primary_locale_name]) : {}
end
def flat_hash(data, prefix = '', result = {})
data.each do |key, value|
current_prefix = prefix.present? ? "#{prefix}.#{key}" : key