Skip to content

Commit

Permalink
Fix rails/rails#19419 for all field labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Mar 26, 2015
1 parent cc8be70 commit 6220777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/blacklight/configuration_helper_behavior.rb
Expand Up @@ -118,7 +118,7 @@ def view_label view
# @param [Symbol] any number of additional keys
# @param [Symbol] ...
def field_label *i18n_keys
first, *rest = i18n_keys
first, *rest = i18n_keys.compact

t(first, default: rest)
end
Expand Down
7 changes: 7 additions & 0 deletions spec/helpers/configuration_helper_spec.rb
Expand Up @@ -159,6 +159,13 @@

label = helper.field_label :key_a, :key_b, "default text"
end

it "should compact nil keys (fixes rails/rails#19419)" do
allow(helper).to receive(:t).with(:key_a, default: [:key_b])

label = helper.field_label :key_a, nil, :key_b

end
end

describe "#default_per_page" do
Expand Down

0 comments on commit 6220777

Please sign in to comment.