Created
April 8, 2010 23:11
-
-
Save hallelujah/360661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/gettext_i18n_rails/backend.rb b/lib/gettext_i18n_rails/backend.rb | |
index b27344b..2932262 100644 | |
--- a/lib/gettext_i18n_rails/backend.rb | |
+++ b/lib/gettext_i18n_rails/backend.rb | |
@@ -20,7 +20,7 @@ module GettextI18nRails | |
_(flat_key) | |
else | |
if self.class.translate_defaults | |
- options[:default].to_a.each do |default| | |
+ Array.wrap(options[:default]).each do |default| | |
#try the more specific key first e.g. 'activerecord.errors.my custom message' | |
flat_key = flatten_key default, options | |
return FastGettext._(flat_key) if FastGettext.key_exist?(flat_key) | |
@@ -44,4 +44,4 @@ module GettextI18nRails | |
scope.empty? ? key.to_s : "#{scope*'.'}.#{key}" | |
end | |
end | |
-end | |
\ No newline at end of file | |
+end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NoMethodError: undefined method `wrap' for Array:Class ;)