From 621d949033d457a44f4eaf44d3d6194c54159577 Mon Sep 17 00:00:00 2001 From: Anton Batenev Date: Thu, 6 Jun 2013 22:20:17 +0400 Subject: [PATCH] Update js_locale_helper.rb Fix "undefined method `end_with?' for 1:Fixnum" when field name in YML file is not quoted number like: ``` user_action_groups: 1: "Likes Given" 2: "Likes Received" ``` (yamllint.com validates such file as valid YML file) --- lib/js_locale_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb index f31d354f3..c308c275a 100644 --- a/lib/js_locale_helper.rb +++ b/lib/js_locale_helper.rb @@ -62,7 +62,7 @@ module JsLocaleHelper hash.each do |k,v| if Hash === v rval.merge!(strip_out_message_formats!(v, prefix + (prefix.length > 0 ? "." : "") << k, rval)) - elsif k.end_with?("_MF") + elsif k.to_s().end_with?("_MF") rval[prefix + (prefix.length > 0 ? "." : "") << k] = v hash.delete(k) end