Permalink
Browse files

avoid converting locale to hash twice

  • Loading branch information...
1 parent 81f5206 commit 20637bd02b2da7f1abd2e3bb45638ef08bbeb423 @mislav mislav committed May 26, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 app/models/tolk/locale.rb
@@ -94,7 +94,11 @@ def dump_all(to = self.locales_config_path)
secondary_locales.each do |locale|
File.open("#{to}/#{locale.name}.yml", "w+") do |file|
data = locale.to_hash
- data.respond_to?(:ya2yaml) ? file.write(data.ya2yaml(:syck_compatible => true)) : YAML.dump(locale.to_hash, file)
+ if data.respond_to?(:ya2yaml)
+ file.write(data.ya2yaml(:syck_compatible => true))
+ else
+ YAML.dump(data, file)
+ end
end
end
end

0 comments on commit 20637bd

Please sign in to comment.