diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-20 17:58:54 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-20 18:00:01 -0300 |
commit | 7815fe4634fcb255583631fa84b50aeeeab0d51e (patch) | |
tree | 3e5c3d5a5f37339b8ff35afe45eb13fb9acc4daa /actionview/lib/action_view | |
parent | 013b716f384a090f189ea7a98efd4c4171555454 (diff) | |
download | rails-7815fe4634fcb255583631fa84b50aeeeab0d51e.tar.gz rails-7815fe4634fcb255583631fa84b50aeeeab0d51e.tar.bz2 rails-7815fe4634fcb255583631fa84b50aeeeab0d51e.zip |
Merge pull request #19421 from jcoyne/translate_defaults_with_nil
Strip nils out of default translations. Fixes #19419
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/translation_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/translation_helper.rb b/actionview/lib/action_view/helpers/translation_helper.rb index 24b633c5bb..29a0860c00 100644 --- a/actionview/lib/action_view/helpers/translation_helper.rb +++ b/actionview/lib/action_view/helpers/translation_helper.rb @@ -38,7 +38,7 @@ module ActionView def translate(key, options = {}) options = options.dup has_default = options.has_key?(:default) - remaining_defaults = Array(options.delete(:default)) + remaining_defaults = Array(options.delete(:default)).compact if has_default && !remaining_defaults.first.kind_of?(Symbol) options[:default] = remaining_defaults.shift |